backport: add eventstream helper for rpc/client (#7987)#9659
Merged
sergio-mena merged 1 commit intotendermint:feature/adr075-backportfrom Nov 17, 2022
Merged
Conversation
This allows the caller to stream events. It handles the bookkeeping for cursors and pagination, and delivers items to a callback. Handle missed items by reporting a structured error. The caller can use the Reset method to "catch up" to head after this happens. Add a manual test CLI to probe a running node. Requires the node to be configured with the event log settings. Add a unit test that scripts input to the stream to exercise it.
Contributor
|
Will review soon (sorry for delay) |
sergio-mena
reviewed
Nov 17, 2022
| func makeTestItem(cur, data string) testItem { | ||
| return testItem{ | ||
| Cursor: cur, | ||
| Data: fmt.Sprintf(`%q`, data), |
Contributor
There was a problem hiding this comment.
The original Sprintf formatting is:
`{"type":%q,"value":%q}`, types.EventDataString("").TypeTag(), data
Any reason why you simplified it?
Author
There was a problem hiding this comment.
To adjust json.Marshal while origin could make use of jsontypes.Marshal
Contributor
Author
sergio-mena
approved these changes
Nov 17, 2022
Contributor
sergio-mena
left a comment
There was a problem hiding this comment.
Thanks for your patience!
mmsqe
added a commit
to mmsqe/tendermint
that referenced
this pull request
Dec 9, 2022
This allows the caller to stream events. It handles the bookkeeping for cursors and pagination, and delivers items to a callback. Handle missed items by reporting a structured error. The caller can use the Reset method to "catch up" to head after this happens. Add a manual test CLI to probe a running node. Requires the node to be configured with the event log settings. Add a unit test that scripts input to the stream to exercise it. Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
mmsqe
added a commit
to mmsqe/tendermint
that referenced
this pull request
Dec 9, 2022
This allows the caller to stream events. It handles the bookkeeping for cursors and pagination, and delivers items to a callback. Handle missed items by reporting a structured error. The caller can use the Reset method to "catch up" to head after this happens. Add a manual test CLI to probe a running node. Requires the node to be configured with the event log settings. Add a unit test that scripts input to the stream to exercise it. Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
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.
For the full description, see #7987
PR checklist
CHANGELOG_PENDING.mdupdated, or no changelog entry neededdocs/) and code comments, or nodocumentation updates needed