Merged
Conversation
883bc36 to
d1944df
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements the
GET /eventsendpoint which provides a newline-delimited stream of JSON objects. Currently, it implements 3 types of events:init,tx, &primaryChange./cc @tantaman
TODO
Event Types
initThe
initevent is currently identical to theprimaryChangeevent in that it shows information about this primary status. It is always the first event published.txThe
txevent is published every time a new LTX is written by the node or is received and applied from the primary.primaryChangeThe
primaryChangeevent shows information about this primary status. It is delivered when the node becomes primary, loses primary status, connects to a primary, or loses its connection to the primary.Usage
$ curl localhost:20202/events {"type":"init","data":{"isPrimary":true}} {"type":"tx","db":"db","data":{"txID":"0000000000000027","postApplyChecksum":"83b05248774ce767","pageSize":4096,"commit":2,"timestamp":"2023-09-06T19:12:34.985Z"}} {"type":"tx","db":"db","data":{"txID":"0000000000000028","postApplyChecksum":"8467267f644a1b66","pageSize":4096,"commit":2,"timestamp":"2023-09-06T19:12:39.586Z"}}