rpc: implement the ADR 075 /events method#7965
Conversation
50d2663 to
03192a8
Compare
c84cfa3 to
9ba6ec9
Compare
7b79f8f to
bb3200a
Compare
| // and we want to keep waiting until we have relevant results (or time out). | ||
| cur := after | ||
| for len(items) == 0 { | ||
| info, err = env.EventLog.WaitScan(ctx, cur, accept) |
There was a problem hiding this comment.
Q about this implementation: does WaitScan allow the full ctx to elapse or does it scan the list as soon as items are available? A client may have listed that they are willing to wait a long time for items and want a lot of items. If such a client arrives at an empty list that then has 1 item appended followed by a ton of items, I think they will just get the 1 item back, which feels a little off since they are still willing to wait for the entire waitTime for their items.
There was a problem hiding this comment.
It returns as soon as it has something. That's how it's defined in the ADR but it wouldn't be hard to change it to keep trying.
I think we probably want to return eagerly though:
A client who's waiting has already found no matches, so they're right at the head of the log. Do they want to wait for more items or have the new data ASAP? We can't know, but if they want "more" they can easily call again (and probably reuse the same HTTP connection).
By contrast if they DIDN'T want to wait, they have to kinda tune their timeout carefully and will wind up polling rapidly just to avoid stalling.
So my intuition is that eager is better, but it isn't much work to change it if there's a good case for waiting.
This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this.
- Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination
b20ede2 to
006dc60
Compare
This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this. - Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination
This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this. - Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination
This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this. - Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination
This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this. - Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination
This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this. - Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination
This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this. - Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination
* rpc: implement the ADR 075 /events method (#7965) This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this. - Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination * add MatchesEvents test * add TODO due to backport sequence Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
…dermint#9497) * rpc: implement the ADR 075 /events method (tendermint#7965) This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this. - Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination * add MatchesEvents test * add TODO due to backport sequence Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
…dermint#9497) * rpc: implement the ADR 075 /events method (tendermint#7965) This method implements the eventlog extension interface to expose ABCI metadata to the log for query processing. Only the types that have ABCI events need to implement this. - Add an event log to the environment - Add a sketch of the handler method - Add an /events RPCFunc to the route map - Implement query logic - Subscribe to pubsub if confingured, handle termination * add MatchesEvents test * add TODO due to backport sequence Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
This change implements the new method on the RPC environment, and adds data types for the parameters and results of that method.
It also updates the event data types that have ABCI events to expose them to the event log.