Git Product home page Git Product logo

sdk-core's Introduction

Build status

Core SDK that can be used as a base for all other Temporal SDKs.

Getting started

See the Architecture doc for some high-level information.

This repo uses a submodule for upstream protobuf files. The path protos/api_upstream is a submodule -- when checking out the repo for the first time make sure you've run git submodule update --init --recursive. TODO: Makefile.

Dependencies

  • Protobuf compiler

Development

All of the following commands are enforced for each pull request.

Building and testing

You can buld and test the project using cargo: cargo build cargo test

Formatting

To format all code run: cargo fmt --all

Linting

We are using clippy for linting. You can run it using: cargo clippy --all -- -D warnings

Debugging

The crate uses tracing to help with debugging. To enable it for a test, insert the below snippet at the start of the test. By default, tracing data is output to stdout in a (reasonably) pretty manner, and to a Jaeger instance if one exists.

core_tracing::tracing_init();
let s = info_span!("Test start");
let _enter = s.enter();

To run the Jaeger instance: docker run --rm -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest Jaeger collection is off by default, you must set TEMPORAL_ENABLE_OPENTELEMENTRY=true in the environment to enable it.

To show logs in the console, set the RUST_LOG environment variable to temporal_sdk_core=DEBUG or whatever level you desire. The env var is parsed according to tracing's EnvFilter rules.

If you are working on a language SDK, you are expected to initialize tracing early in your main equivalent.

Style Guidelines

Error handling

Any error which is returned from a public interface should be well-typed, and we use thiserror for that purpose.

Errors returned from things only used in testing are free to use anyhow for less verbosity.

sdk-core's People

Contributors

sushisource avatar vitarb avatar bergundy avatar mfateev avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.