Crates.io | temporal-sdk-core |
lib.rs | temporal-sdk-core |
version | 0.1.0-alpha.1 |
source | src |
created_at | 2021-04-22 19:17:36.902249 |
updated_at | 2021-04-22 19:17:36.902249 |
description | Library for building new Temporal SDKs |
homepage | https://temporal.io/ |
repository | https://github.com/temporalio/sdk-core |
max_upload_size | |
id | 388267 |
size | 580,866 |
Core SDK that can be used as a base for all other Temporal SDKs.
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.
All of the following commands are enforced for each pull request.
You can buld and test the project using cargo:
cargo build
cargo test
To format all code run:
cargo fmt --all
We are using clippy for linting.
You can run it using:
cargo clippy --all -- -D warnings
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.
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.