Struct actyxos_sdk::event_service::EventService[][src]

pub struct EventService { /* fields omitted */ }
Expand description

An Event Service API client with which you can perform queries and publish events.

This feature is only available under the client feature flag.

The common way to create an EventService instance is to use the default constructor:

use actyxos_sdk::event_service::EventService;

let event_service: EventService = EventService::default();

This will connect to the local Event Service, either an ActyxOS node in development mode or the production ActyxOS node where the app is deployed (in particular, it will inspect the AX_EVENT_SERVICE_URI environment variable and fall back to http://localhost:4454/api/).

Implementations

Construct a new client from a reqwest Client and a base URL. The URL must end with a slash as the endpoints below it are resolved as relative paths.

Obtain an OffsetMap that describes the set of all events currently known to the Event Service. New events are continuously ingested from other ActyxOS nodes, which means that calling this method again at a later time is likely to produce a larger OffsetMap.

Obtain the local ActyxOS node ID

Request a stream of events from the beginning of time until the given upper bound that must be less than or equal to the currently returned result of get_offsets (using that result here is quite common).

The order of events is specified independently, i.e. if you ask for LamportReverse order you’ll get the events starting with upper_bound and going backwards down to the beginning of time.

The delivered event stream will be filtered by the subscriptions: an event is included if any of the subscriptions matches.

Request a stream of events from the given lower bound until the given upper bound that must be less than or equal to the currently returned result of get_offsets (using that result here is quite common).

The order of events is specified independently, i.e. if you ask for LamportReverse order you’ll get the events starting with upper_bound and going backwards down to the lower bound.

The delivered event stream will be filtered by the subscriptions: an event is included if any of the subscriptions matches.

Subscribe to an unbounded stream of events starting at the beginning of time and continuing past the currently known events (see get_offsets) into live mode.

The common pattern is to take note of consumed events by adding them into an OffsetMap and resuming the stream from this OffsetMap after an app restart using subscribe_from.

The delivered event stream will be filtered by the subscriptions: an event is included if any of the subscriptions matches.

Subscribe to an unbounded stream of events starting at the given lower bound and continuing past the currently known events (see get_offsets) into live mode.

The common pattern is to take note of consumed events by adding them into an OffsetMap and resuming the stream from this OffsetMap after an app restart.

The delivered event stream will be filtered by the subscriptions: an event is included if any of the subscriptions matches.

Publish the given sequence of event payloads in that order in the stream identified by the given semantics and name. The ActyxOS node will automatically add the local source ID to mark the origin.

Trait Implementations

This will configure a connection to the local Event Service, either an ActyxOS node in development mode or the production ActyxOS node where the app is deployed (in particular, it will inspect the AX_EVENT_SERVICE_URI environment variable and fall back to http://localhost:4454/api/).

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more