events

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnpublishedEventsCheckInterval        = 1 * time.Minute
	ConnCheckInterval                     = 100 * time.Millisecond
	MaxUnpublishedEvents           uint64 = 1e4
	MaxEventStreamLen              int64  = 1e6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	// Encode encodes event to map.
	Encode() (map[string]interface{}, error)
}

Event represents an event.

type EventHandler

type EventHandler interface {
	// Handle handles events passed by underlying implementation.
	Handle(ctx context.Context, event Event) error
}

EventHandler represents event handler for Subscriber.

type Publisher

type Publisher interface {
	// Publish publishes event to stream.
	Publish(ctx context.Context, event Event) error

	// Close gracefully closes event publisher's connection.
	Close() error
}

Publisher specifies events publishing API.

type Subscriber

type Subscriber interface {
	// Subscribe subscribes to the event stream and consumes events.
	Subscribe(ctx context.Context, handler EventHandler) error

	// Close gracefully closes event subscriber's connection.
	Close() error
}

Subscriber specifies event subscription API.

Directories

Path Synopsis
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.
Package redis contains the domain concept definitions needed to support Magistrala redis events source service functionality.

Jump to

Keyboard shortcuts

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