You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[DXFR-81][Rust] Promises can be awaited in async code.
Promise and AnyOf implement IntoFuture (PromiseFuture, AnyOfFuture), so async code awaits them instead
of blocking a thread in wait. The futures work on any executor (tokio, async-std, smol or another); the crate
depends on no runtime and needs no cargo feature for them.
PromiseFuture::cancel makes the future ready at once, so a timer of the runtime that cancels it is the async
timeout. Dropping the future does not cancel the request.
system::shutdown makes the pending futures ready with Error::ShutDown.
[DXFR-82][Rust] Subscriptions can be consumed as async streams of owned events.
DXFeedSubscription::into_stream and DXFeedTimeSeriesSubscription::into_stream turn a subscription into an EventStream. Its buffer drops and counts the oldest events when it is full; into_stream_with takes StreamOptions::bounded with another capacity or StreamOptions::unbounded.
The stream ends when it or its subscription is closed, when all its endpoints are closed and on system::shutdown.
The new cargo feature stream implements futures_core::Stream for the streams; without it they have their own next and poll_next.
[DXFR-83][Rust] The crate docs index common tasks and give examples of subscriptions, symbols, promises, the
transaction models and the main event types; the crate docs and the README have an Async section.
[DXFR-84][Rust] Event streams can take their events from an event queue.
With StreamOptions::event_queue, the events stay in the SDK until a task waits for them, so the SDK conflates
the lasting events (the last quote of each symbol) while the consumer lags; dropped() counts what the SDK lost.
An endpoint that awaits its termination (close_and_await_termination) does not wait for the consumer: the
stream takes what the queue holds.
[DXFR-85][Rust] The transactional models and the order books can be consumed as async streams.
build_stream of the builders of IndexedTxModel and TimeSeriesTxModel makes a ModelStream of Transactions, one per transaction or snapshot.
build_stream of MarketDepthModelBuilder and OrderBookModel::into_stream make a ModelStream of BookSides, the whole book after a change.
A model stream never splits an item: when its consumer lags, a snapshot drops the buffered transactions of its
source and a book replaces the buffered book; otherwise the buffer grows. It ends as an event stream does.
[DXFR-86][Rust] A shared event queue can be consumed as an async stream.
SharedEventQueue::into_stream makes a TaggedEventStream of (tag, Event): the events of all the
subscriptions attached to the queue, taken only while a task waits. The work of the executor of the queue
(models, the collector, promise handlers) runs in those polls.
The stream does not own the subscriptions. Closing an endpoint does not end it, as its subscriptions may come
from any endpoint: it ends when it or its queue is closed and on system::shutdown.
For integrators
Depend on dxfeed-graal = "0.4". The crates still use dxFeed Graal Native SDK 3.16.0: dxfeed-graal-sys is 0.4.0+sdk.3.16.0 and its bindings do not change.