Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Event Processor SDK #48

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

peterschwarz
Copy link
Contributor

This RFC proposes extensions to the Sawtooth SDK's to support event
processing. These events are emitted by the validator on block commits
and can be subscribed to via client messages.

These SDK extensions propose a simplified abstraction on top of these
client messages in order to provide a simple model for handling the
events. This API is akin to the Transaction Handler/Transaction
Processor API's.

Signed-off-by: Peter Schwarz pschwarz@bitwise.io

This RFC proposes extensions to the Sawtooth SDK's to support event
processing.  These events are emitted by the validator on block commits
and can be subscribed to via client messages.

These SDK extensions propose a simplified abstraction on top of these
client messages in order to provide a simple model for handling the
events.  This API is akin to the Transaction Handler/Transaction
Processor API's.

Signed-off-by: Peter Schwarz <pschwarz@bitwise.io>
{ ... }

impl EventProcessor {
pub fn new(validator_endpoint: String) -> Self

Choose a reason for hiding this comment

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

[nitpick]: Missing {} has broken the syntax highlighter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

-> Self
{ ... }

fn with_regex_filter(

Choose a reason for hiding this comment

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

[Thinking out loud]: Can this be trait object passed to a function like "with_filter()", where is either regex or simple or something else coming up later.

Fix code snippet for proper syntax highlighting.

Signed-off-by: Peter Schwarz <pschwarz@bitwise.io>
Copy link

@danintel danintel left a comment

Choose a reason for hiding this comment

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

I assume this documents existing event handling. I see where you describe creating a subscription, then you jump to event handling. Missing is any description of how/where to send the subscription, and an API to listen to the event subscription response.

A Rust example would be nice.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants