|
3 | 3 | title: |
|
4 | 4 | 29. EventSource & EventSink abstractions
|
5 | 5 | authors: [@cardenaso11, @quantumplation, @ch1bo]
|
6 |
| -tags: [] |
| 6 | +tags: [Draft] |
7 | 7 | ---
|
8 | 8 |
|
9 | 9 | ## Status
|
@@ -47,25 +47,36 @@ data HydraNode tx m = HydraNode
|
47 | 47 | }
|
48 | 48 | ```
|
49 | 49 |
|
50 |
| -* The `stepHydraNode` main loop does call `putEvent` on all `eventSinks` in sequence. |
51 |
| - |
52 |
| - - TBD: transaction semantics? what happens if one fails? |
| 50 | +* The `hydra-node` will load events and __hydra_te its `HeadState` using `getEvents` of the single `eventSource`. |
53 | 51 |
|
54 |
| -* The default `hydra-node` main loop does use the file-based `EventSource` and a single file-based `EventSink` (using the same file). |
| 52 | +* The `stepHydraNode` main loop does call `putEvent` on all `eventSinks` in sequence. Any failure will make the `hydra-node` process terminate and require a restart. |
| 53 | + |
| 54 | +* When loading events from `eventSource` on `hydra-node` startup, it will also re-submit events via `putEvent` to all `eventSinks`. |
55 | 55 |
|
56 |
| -* TBD: As the node starts up, when loading events from the `EventSource`, it will also ensure "at least once" semantics for each `EventSink`. |
| 56 | +* The default `hydra-node` main loop does use the file-based `EventSource` and a single file-based `EventSink` (using the same file). |
57 | 57 |
|
58 | 58 | * We realize that the `EventSource` and `EventSink` handles, as well as their aggregation in `HydraNode` are used as an API by forks of the `hydra-node` and try to minimize changes to it.
|
59 | 59 |
|
60 | 60 | ## Consequences
|
61 | 61 |
|
62 | 62 | * The default operation of the `hyda-node` remains unchanged.
|
| 63 | + |
63 | 64 | * There are other things called `Event` and `EventQueue(putEvent)` right now in the `hydra-node`. This is getting confusing and when we implement this, we should also rename several things first (tidying).
|
| 65 | + |
| 66 | +* Interface first: Implementations of `EventSink` should specify their format in a non-ambiguous and versioned way, especially when a corresponding `EventSource` exists. |
| 67 | + |
64 | 68 | * The API `Server` can be modelled and refactored as an `EventSink`.
|
65 |
| - - TBD: Do `Network` and `Chain` parts qualify as `EventSink`s as well or shall those be triggered by `Effect`s still? |
66 |
| -* Projects forking the hydra node have a natively extensions points for producing and consuming events. |
67 |
| -* TBD: These extensions can preserve robust "at least once" semantics for each hydra event. |
| 69 | + |
| 70 | +* Projects forking the hydra node have dedicated extension points for producing and consuming events. |
| 71 | + |
68 | 72 | * Sundae Labs can build a "Save transaction batches to S3" proof of concept `EventSink`.
|
69 | 73 | * Sundae Labs can build a "Scrolls source" `EventSink`.
|
70 | 74 | * Sundae Labs can build a "Amazon Kinesis" `EventSource` and `EventSink`.
|
71 |
| -* Extension points like `EventSource` and `EventSink` could be dynamically loaded as plugins without having to fork `hydra-node` (maybe in a future ADR). |
| 75 | + |
| 76 | +## Out of scope / future work |
| 77 | + |
| 78 | +* Available implementations for `EventSource` and `EventSink` could be |
| 79 | + - configured upon `hydra-node` startup using for example URIs: `--event-source file://state` or `--event-sink s3://some-bucket` |
| 80 | + - dynamically loaded as plugins without having to fork `hydra-node`. |
| 81 | + |
| 82 | +* The `Network` and `Chain` parts qualify as `EventSink`s as well or shall those be triggered by `Effect`s still? |
0 commit comments