Documentation ¶
Index ¶
- Constants
- type EventBroker
- func (eb *EventBroker) PublishLogs(l event.Logs)
- func (eb *EventBroker) PublishNewHeads(b event.Block)
- func (eb *EventBroker) Start()
- func (eb *EventBroker) SubscribeLogs(opts request.LogSubscriptionOptions, ch chan event.Logs) broker.Subscription
- func (eb *EventBroker) SubscribeNewHeads(ch chan event.Block) broker.Subscription
- func (eb *EventBroker) UnsubscribeFromLogs(sub broker.Subscription)
- func (eb *EventBroker) UnsubscribeFromNewHeads(sub broker.Subscription)
- type EventSubscription
- type Type
Constants ¶
const ( // LogsChSize is the size of channel listening to Logs types. LogsChSize = 5 // NewHeadsChSize is the size of channel listening to NewHeads types. NewHeadsChSize = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventBroker ¶
type EventBroker struct { DebugInfo chan int // contains filtered or unexported fields }
EventBroker offers support to manage types subscriptions and broadcast the incoming events to subscribed objects.
func NewEventBroker ¶
func NewEventBroker() *EventBroker
NewEventBroker creates a new EventBroker object
func (*EventBroker) PublishLogs ¶
func (eb *EventBroker) PublishLogs(l event.Logs)
PublishLogs provides publish API for logs types. Implements broker.Broker interface
func (*EventBroker) PublishNewHeads ¶
func (eb *EventBroker) PublishNewHeads(b event.Block)
PublishNewHeads provides publish API for new block head types. Implements broker.Broker interface
func (*EventBroker) Start ¶
func (eb *EventBroker) Start()
Start main loop of the EventBroker that receives and distributes the events.
func (*EventBroker) SubscribeLogs ¶
func (eb *EventBroker) SubscribeLogs(opts request.LogSubscriptionOptions, ch chan event.Logs) broker.Subscription
SubscribeLogs creates a new subscription and signals the EventBroker subscription channel to handle the subscription map
func (*EventBroker) SubscribeNewHeads ¶
func (eb *EventBroker) SubscribeNewHeads(ch chan event.Block) broker.Subscription
SubscribeNewHeads creates a new subscription and signals the EventBroker subscription channel to handle the subscription map
func (*EventBroker) UnsubscribeFromLogs ¶
func (eb *EventBroker) UnsubscribeFromLogs(sub broker.Subscription)
UnsubscribeFromLogs signals the EventBroker's related channel to delete the subscription
func (*EventBroker) UnsubscribeFromNewHeads ¶
func (eb *EventBroker) UnsubscribeFromNewHeads(sub broker.Subscription)
UnsubscribeFromNewHeads signals the EventBroker's related channel to delete the subscription
type EventSubscription ¶
type EventSubscription struct {
// contains filtered or unexported fields
}
func (*EventSubscription) GetId ¶
func (es *EventSubscription) GetId() broker.SubID
GetId returns identifier of the EventSubscription which implements broker.Subscription
func (*EventSubscription) GetLogsCh ¶
func (es *EventSubscription) GetLogsCh() chan event.Logs
GetLogsCh returns the logs types channel of the EventSubscription which implements broker.Subscription
func (*EventSubscription) GetLogsSubOpts ¶
func (es *EventSubscription) GetLogsSubOpts() request.LogSubscriptionOptions
GetLogsSubOpts returns log filters of the EventSubscription which implements broker.Subscription
func (*EventSubscription) GetNewHeadsCh ¶
func (es *EventSubscription) GetNewHeadsCh() chan event.Block
GetNewHeadsCh returns the newHeads types channel of the EventSubscription which implements broker.Subscription