eventstream

package
v0.3.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AckFn added in v0.2.12

type AckFn func() error

type EventBatchCallback added in v0.2.18

type EventBatchCallback func(events []*Message) error

type EventBatcher added in v0.2.12

type EventBatcher interface {
	Register(callback EventBatchCallback)
	Report(event *Message) error
	Stop() error
}

type EventStream

type EventStream interface {
	Publish(events []*api.EventMessage) []error
	Subscribe(queue string, callback func(event *Message) error) error
	Close() error
}

type JetstreamEventStream

type JetstreamEventStream struct {
	// contains filtered or unexported fields
}

func NewJetstreamEventStream

func NewJetstreamEventStream(
	opts *configuration.JetstreamConfig,
	consumerOpts ...jsm.ConsumerOption) (*JetstreamEventStream, error)

func (*JetstreamEventStream) Check

func (c *JetstreamEventStream) Check() error

func (*JetstreamEventStream) Close

func (c *JetstreamEventStream) Close() error

func (*JetstreamEventStream) Publish

func (c *JetstreamEventStream) Publish(events []*api.EventMessage) []error

func (*JetstreamEventStream) Subscribe

func (c *JetstreamEventStream) Subscribe(queue string, callback func(event *Message) error) error

type Message added in v0.2.12

type Message struct {
	EventMessage *api.EventMessage
	Ack          AckFn
}

type StanClient

type StanClient interface {
	PublishAsync(subject string, data []byte, ah stan.AckHandler) (string, error)
	QueueSubscribe(subject, queue string, cb stan.MsgHandler, opts ...stan.SubscriptionOption) error
	Close() error
}

type StanClientConnection

type StanClientConnection struct {
	// contains filtered or unexported fields
}

func NewStanClientConnection

func NewStanClientConnection(
	stanClusterID, clientID string, servers []string,
	options ...stan.Option) (*StanClientConnection, error)

func (*StanClientConnection) Check

func (c *StanClientConnection) Check() error

func (*StanClientConnection) Close

func (c *StanClientConnection) Close() error

func (*StanClientConnection) PublishAsync

func (c *StanClientConnection) PublishAsync(subject string, data []byte, ah stan.AckHandler) (string, error)

func (*StanClientConnection) QueueSubscribe

func (c *StanClientConnection) QueueSubscribe(subject, qgroup string, cb stan.MsgHandler, opts ...stan.SubscriptionOption) error

type StanEventStream

type StanEventStream struct {
	// contains filtered or unexported fields
}

func NewStanEventStream

func NewStanEventStream(subject string, stanClient StanClient, subscriptionOptions ...stan.SubscriptionOption) *StanEventStream

func (*StanEventStream) Close

func (stream *StanEventStream) Close() error

func (*StanEventStream) Publish

func (stream *StanEventStream) Publish(events []*api.EventMessage) []error

func (*StanEventStream) Subscribe

func (stream *StanEventStream) Subscribe(queue string, callback func(event *Message) error) error

type TimedEventBatcher added in v0.2.12

type TimedEventBatcher struct {
	// contains filtered or unexported fields
}

func NewTimedEventBatcher added in v0.2.12

func NewTimedEventBatcher(batchSize int, maxTimeBetweenBatches time.Duration, timeout time.Duration) *TimedEventBatcher

func (*TimedEventBatcher) Register added in v0.2.12

func (b *TimedEventBatcher) Register(callback EventBatchCallback)

Process is started when the callback is registered

func (*TimedEventBatcher) Report added in v0.2.12

func (b *TimedEventBatcher) Report(event *Message) error

func (*TimedEventBatcher) Stop added in v0.2.12

func (b *TimedEventBatcher) Stop() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL