Documentation ¶
Index ¶
- func NewBufferFilesEventSource(bufferFilesDir string, timeBetweenBlocks time.Duration, ...) (*bufferFileEventSource, error)
- func NewEventReceiverSender(config Config, log *logging.Logger, chainID string) (rawEventReceiverSender, error)
- func NewFanOutEventSource(source EventReceiver, sendChannelBufferSize int, expectedNumSubscribers int) *fanOutEventSource
- func ReadRawEvent(eventFile *os.File, offset int64) (event []byte, seqNum uint64, totalBytesRead uint32, err error)
- type BlockStore
- type Broker
- type BufferedEventSourceConfig
- type ChainInfoI
- type Config
- type Deserializer
- type EventReceiver
- type FileBufferedEventSource
- type FileEventSourceConfig
- type OrderEventWithVegaTime
- type ProtocolUpgradeHandler
- type RawEventReceiver
- type SQLBrokerSubscriber
- type SQLStoreBroker
- type SQLStoreEventBroker
- type SocketConfig
- type TestInterface
- type TransactionManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBufferFilesEventSource ¶ added in v0.69.0
func NewEventReceiverSender ¶ added in v0.65.0
func NewFanOutEventSource ¶
func NewFanOutEventSource(source EventReceiver, sendChannelBufferSize int, expectedNumSubscribers int) *fanOutEventSource
Types ¶
type BlockStore ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker - the base broker type perhaps we can extend this to embed into type-specific brokers.
func New ¶
func New(ctx context.Context, log *logging.Logger, config Config, chainID string, eventsource EventReceiver, ) (*Broker, error)
New creates a new base broker.
func (*Broker) Subscribe ¶
func (b *Broker) Subscribe(s broker.Subscriber) int
Subscribe registers a new subscriber, returning the key.
func (*Broker) SubscribeBatch ¶
func (b *Broker) SubscribeBatch(subs ...broker.Subscriber)
func (*Broker) Unsubscribe ¶
Unsubscribe removes subscriber from broker this does not change the state of the subscriber.
type BufferedEventSourceConfig ¶ added in v0.61.0
type BufferedEventSourceConfig struct { EventsPerFile int `description:"the number of events to store in a file buffer, set to 0 to disable the buffer" long:"events-per-file"` SendChannelBufferSize int `description:"sink event channel buffer size" long:"send-buffer-size"` Archive bool `description:"archives event buffer files after they have been read, default false" long:"archive"` ArchiveMaximumSizeBytes int64 `description:"the maximum size of the archive directory" long:"archive-maximum-size"` }
type ChainInfoI ¶
type Config ¶
type Config struct { Level encoding.LogLevel `long:"log-level"` SocketConfig SocketConfig `group:"Socket" namespace:"socket"` SocketServerInboundBufferSize int `long:"socket-server-inbound-buffer-size"` SocketServerOutboundBufferSize int `long:"socket-server-outbound-buffer-size"` FileEventSourceConfig FileEventSourceConfig `group:"FileEventSourceConfig" namespace:"fileeventsource"` UseEventFile encoding.Bool `description:"set to true to source events from a file" long:"use-event-file"` PanicOnError encoding.Bool `description:"if an error occurs on event push the broker will panic, else log the error" long:"panic-on-error"` UseBufferedEventSource encoding.Bool `description:"if true datanode will buffer events" long:"use-buffered-event-source"` BufferedEventSourceConfig BufferedEventSourceConfig `group:"BufferedEventSource" namespace:"bufferedeventsource"` EventBusClientBufferSize int `long:"event-bus-client-buffer-size"` }
Config represents the configuration of the broker.
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig creates an instance of config with default values.
type Deserializer ¶ added in v0.69.0
type Deserializer struct {
// contains filtered or unexported fields
}
func NewDeserializer ¶ added in v0.69.0
func NewDeserializer(source RawEventReceiver) *Deserializer
func (*Deserializer) Listen ¶ added in v0.69.0
func (e *Deserializer) Listen() error
type EventReceiver ¶ added in v0.65.0
type FileBufferedEventSource ¶ added in v0.61.0
type FileBufferedEventSource struct {
// contains filtered or unexported fields
}
func NewBufferedEventSource ¶ added in v0.61.0
func NewBufferedEventSource(ctx context.Context, log *logging.Logger, config BufferedEventSourceConfig, source RawEventReceiver, bufferFilesDir string, archiveFilesDir string, ) (*FileBufferedEventSource, error)
func (*FileBufferedEventSource) Listen ¶ added in v0.61.0
func (m *FileBufferedEventSource) Listen() error
type FileEventSourceConfig ¶
type FileEventSourceConfig struct { Directory string `description:"the directory container the event files" long:"directory"` TimeBetweenBlocks encoding.Duration `description:"the time between sending blocks" string:"time-between-blocks"` SendChannelBufferSize int `description:"size of channel buffer used to send events to broker " long:"send-buffer-size"` }
type OrderEventWithVegaTime ¶
func (*OrderEventWithVegaTime) GetOrder ¶
func (oe *OrderEventWithVegaTime) GetOrder() *vega.Order
func (*OrderEventWithVegaTime) VegaTime ¶
func (oe *OrderEventWithVegaTime) VegaTime() time.Time
type ProtocolUpgradeHandler ¶ added in v0.63.0
type RawEventReceiver ¶ added in v0.69.0
type SQLBrokerSubscriber ¶ added in v0.55.0
type SQLStoreBroker ¶ added in v0.57.0
type SQLStoreBroker struct {
// contains filtered or unexported fields
}
SQLStoreBroker : push events to each subscriber with a single go routine across all types.
func NewSQLStoreBroker ¶ added in v0.55.0
func NewSQLStoreBroker( log *logging.Logger, config Config, chainID string, eventsource EventReceiver, transactionManager TransactionManager, blockStore BlockStore, onBlockCommitted func(ctx context.Context, chainId string, lastCommittedBlockHeight int64, snapshotTaken bool), protocolUpdateHandler ProtocolUpgradeHandler, subs []SQLBrokerSubscriber, ) *SQLStoreBroker
type SQLStoreEventBroker ¶ added in v0.55.0
type SocketConfig ¶
type TestInterface ¶ added in v0.55.0
type TestInterface interface { Send(event events.Event) Subscribe(s broker.Subscriber) int SubscribeBatch(subs ...broker.Subscriber) Unsubscribe(k int) Receive(ctx context.Context) error }
TestInterface interface (horribly named) is declared here to provide a drop-in replacement for broker mocks used throughout in addition to providing the classical mockgen functionality, this mock can be used to check the actual events that will be generated so we don't have to rely on test-only helper functions.