1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Event sink abstraction.
//!
//! Sinks are the consumer side of the event pipeline. The [`EventSink`](crate::sink::EventSink) trait
//! defines a common interface for any downstream target. Built-in
//! implementations are provided for in-memory channels and inline callbacks.
use async_trait;
use CancellationToken;
use crateResult;
use crateMarketEvent;
/// The common interface for all event consumers.
///
/// Implementors receive batches of [`MarketEvent`] items. The trait is
/// `#[async_trait]` because sinks typically perform I/O (network send, disk
/// flush, etc.).
///
/// # Graceful shutdown
///
/// The `shutdown` method is called when the loader stops. Use it to flush
/// buffers or close connections.