Skip to content

rpc: implement the eventlog defined by ADR 075#7825

Merged
creachadair merged 10 commits intomasterfrom
mjf/adr075-eventlog
Feb 21, 2022
Merged

rpc: implement the eventlog defined by ADR 075#7825
creachadair merged 10 commits intomasterfrom
mjf/adr075-eventlog

Conversation

@creachadair
Copy link

@creachadair creachadair commented Feb 15, 2022

Implement the basic cursor and eventlog types described in ADR 075. Handle
encoding and decoding as strings for compatibility with JSON.

  • Add unit tests for the required order and synchronization properties.
  • Add hooks for metrics, with one value to be expanded later.
  • Update ADR language so align names with the implementation.

Note to reviewers

This is the largest single unit of the implementation. This PR does not include the plumbing to make the ADR 075 events interface usable. That will follow in subsequent PRs.

There are two packages here to consider: internal/eventlog and internal/eventlog/cursor. The latter is a subsidiary of the former, so I recommend starting with internal/eventlog.

Design notes


// updateHead replaces the current head with newHead, signals any waiters, and
// resets the wait signal. The caller must hold log.mu exclusively.
func (lg *Log) updateHead(newHead *logEntry) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need a mutex?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does. As noted in the comment, the caller has to hold it. But we don't want a separate mutex for it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I gave it a name mainly for documentation purposes; I could just inline it if you find that easier to read)

@creachadair creachadair force-pushed the mjf/adr075-eventlog branch 16 times, most recently from c5b43e9 to 31d74d7 Compare February 18, 2022 18:26
@creachadair creachadair force-pushed the mjf/adr075-eventlog branch 3 times, most recently from 53d704f to a81db59 Compare February 18, 2022 23:33
@creachadair creachadair force-pushed the mjf/adr075-eventlog branch 3 times, most recently from 41066a5 to f3f8eb1 Compare February 21, 2022 15:28
M. J. Fromberger added 7 commits February 21, 2022 07:50
Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update semantics of event log window.
- Update documentation for long polling.
- Update JSON tags to match the implementation.
- Update config variable names to match the implementation.
Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me.

@creachadair creachadair merged commit 705f365 into master Feb 21, 2022
@creachadair creachadair deleted the mjf/adr075-eventlog branch February 21, 2022 16:54
mmsqe pushed a commit to mmsqe/tendermint that referenced this pull request Aug 26, 2022
Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.
mmsqe pushed a commit to mmsqe/tendermint that referenced this pull request Aug 26, 2022
Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.
mmsqe pushed a commit to mmsqe/tendermint that referenced this pull request Aug 30, 2022
Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.
mmsqe pushed a commit to mmsqe/tendermint that referenced this pull request Aug 30, 2022
Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.
mmsqe pushed a commit to mmsqe/tendermint that referenced this pull request Aug 30, 2022
Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.
mmsqe pushed a commit to mmsqe/tendermint that referenced this pull request Sep 13, 2022
Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.
mmsqe pushed a commit to mmsqe/tendermint that referenced this pull request Sep 21, 2022
Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.
sergio-mena pushed a commit that referenced this pull request Sep 23, 2022
* rpc: implement the eventlog defined by ADR 075 (#7825)

Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.

* fix event type

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
mmsqe added a commit to mmsqe/tendermint that referenced this pull request Dec 9, 2022
* rpc: implement the eventlog defined by ADR 075 (tendermint#7825)

Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.

* fix event type

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
mmsqe added a commit to mmsqe/tendermint that referenced this pull request Dec 9, 2022
* rpc: implement the eventlog defined by ADR 075 (tendermint#7825)

Implement the basic cursor and eventlog types described in ADR 075.  Handle
encoding and decoding as strings for compatibility with JSON.

- Add unit tests for the required order and synchronization properties.
- Add hooks for metrics, with one value to be expanded later.
- Update ADR 075 to match the specifics of the implementation so far.

* fix event type

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants