Releases: aljoscha/statefun-rust
Releases · aljoscha/statefun-rust
v0.2.0-alpha
This release includes support for v3.2.0 of Apache Statefun.
The list of changes:
- The main API is still protocol buffers. However the internal payloads (client-defined types) are no longer protocol buffers. Instead they are tagged values called
TypedValue(itself a protobuf message type). This allows the client code to pick its own serialization frameworks, and even use different serialization formats for different structures. It's up to the client code to pick what they want. This is explained in detail here. - v3.x supports cross-language unification of primitive types. This means that for primitive types like
int,float,string, etc, they are all serialized in the same way, making them cross-language compatible. Again see here for more details. More specifically, these types are serialized with Protocol buffers, seeserialization.rsin this repo how this is done. - Any user-defined types which are expected to be passed over the wire must implement two traits:
Serializable, andTypeName.Serializabledefines how the type should be serialized, whereasTypeNameencodes the full name of the type, which could for example beexample.io.truweb/my-type. - Added support for TTL for state values. Function's state can be set to never expire, or to expire after a certain number of time. When set to
AfterInvoke, expiration time begins to count after last read or write, when set toAfterWrite, expiration time begins to count after the initial create or the last write. - Added support for cancellation of delayed invocations by associating delayed invocations with cancellation tokens.
Additional changes include:
- Refactored the library and moved everything into its own module. Previously a lot of the code lived in
lib.rs. There's still some usages of private fields within the library, as a workaround I'm usingpub (crate)-- but we should probably implement getters here. - Now contains 3 examples, one is based on the playground example and uses their own docker image. While the existing kafka example in the SDK has been ported to work with the new SDK. I've also added a separate example demonstrating delayed invocation, cancellation of delayed invocation, and state expiry.
For an intro to v3 changes see these release notes:
Newer minor changes since v3 include:
Statefun Rust SDK v0.1.1
Statefun Rust SDK v0.1.0
Initial release.