actyx_sdk 0.2.0

Tools for interacting with the services of an Actyx node
docs.rs failed to build actyx_sdk-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: actyx_sdk-0.3.0

Latest Version Rust Documentation

Actyx SDK

Actyx makes it easy to run distributed applications on multiple nodes. It is a piece of software that allows you to run your own apps on one or more edge devices and have these apps seamlessly communicate and share data with each other.

This crate defines the data types needed for communicating with Actyx and provides Rust bindings for the Actyx APIs.

Examples

Below you find a full example using the EventService client that retrieves some events. Please adapt the semantics to match your stored events in order to see output.

Note: (this example needs the client feature to compile).

use actyx_sdk::event_service::{EventService,
        EventServiceError, Order, Subscription};
use futures::stream::StreamExt;

#[tokio::main]
pub async fn main() -> Result<(), EventServiceError> {
    // client for locally running Actyx Event Service
    let service = EventService::default();

    // retrieve largest currently known event stream cursor
    let offsets = service.get_offsets().await?;

    // all events matching the given subscription
    // sorted backwards, i.e. youngest to oldest
    let sub = vec![Subscription::semantics("MyFish")];
    let mut events = service
        .query_upto(offsets, sub, Order::LamportReverse)
        .await?;

    // print out the payload of each event
    // (cf. Payload::extract for more options)
    while let Some(event) = events.next().await {
        println!("{}", event.payload.json_value());
    }
    Ok(())
 }

Feature flags

The default is to provide only the data types with serialization and deserialization support for serde. The following features can be enabled in addition: