Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bag ¶ added in v0.4.0
Bag type is an abstract container for octet stream, exchanged via channels. It is used by queuing transport to abstract message on the wire.
type Dequeue ¶ added in v0.4.0
type Dequeue interface {
// Listent activates transport
Listen() error
// Close transport
Close() error
// Deq returns a channel to dequeue messages
Deq() chan *Bag
// Ack returns a channel to acknowledge message processign
Ack() chan *Bag
}
Dequeue is an abstraction of transport protocol to receive messages from queueing system (broker). Dequeue is an abstraction of transport client.
type Enqueue ¶ added in v0.4.0
type Enqueue interface {
// Listent activates transport
Listen() error
// Close transport
Close() error
// Enq returns a channel to enqueue messages
Enq() chan *BagStdErr
// Enqueue synchronously message
EnqSync(*Bag) error
}
Enqueue is an abstraction of transport protocols to send messages for the processing to queueing system (broker). Enqueue is an abstraction of transport client.
type Event ¶ added in v0.5.0
type Event[T any] struct { // // Unique identity for event ID string `json:"@id,omitempty"` // // Canonical IRI that defines a type of action. Type curie.IRI `json:"@type,omitempty"` // // Direct performer of the event, a software service that emits action to the stream. Agent curie.IRI `json:"agent,omitempty"` // // Indirect participants, a user who initiated an event. Participant curie.IRI `json:"participant,omitempty"` // // ISO8601 timestamps when action has been created Created string `json:"created,omitempty"` // // The digest of received event (used internally to ack processing) Digest string `json:"-"` // // The object upon which the event is carried out. Object T `json:"object,omitempty"` }
Event defines immutable fact(s) placed into the queueing system. Event resembles the concept of Action as it is defined by schema.org.
> An action performed by a direct agent and indirect participants upon a direct object.
This type supports development of event-driven solutions that treat data as a collection of immutable facts, which are queried and processed in real-time. These applications processes logical log of events, each event defines a change to current state of the object, i.e. which attributes were inserted, updated or deleted (a kind of diff). The event identifies the object that was changed together with using unique identifier.
type Msg ¶
Msg is a generic envelop type for incoming messages. It contains both decoded object and its digest used to acknowledge message.
type Policy ¶ added in v0.4.0
type Policy struct {
BackoffIO backoff.Seq
PollFrequency time.Duration
TimeToFlight time.Duration
QueueCapacity int
}
Policy defines behavior of queue
func (*Policy) WithBackoffIO ¶ added in v0.4.0
WithBackoffIO configures retry of queue I/O
swarm.NewPolicy(). WithBackoffIO(backoff.Exp(...))
func (*Policy) WithPollFrequency ¶ added in v0.4.0
WithPollFrequency configures frequency of polling loop
swarm.NewPolicy(). WithPollFrequency(5*time.Seconds)
func (*Policy) WithQueueCapacity ¶ added in v0.4.0
type System ¶
type System interface {
ID() string
// Create new queueing endpoint from transport
Queue(string, Enqueue, Dequeue, *Policy) Queue
// Listent activates all transport
Listen() error
// Close system and all queues
Close()
// Wait for system to be stopped
Wait()
}
System of Queues controls group related queues.
Directories
¶
| Path | Synopsis |
|---|---|
|
broker
|
|
|
embedded
module
|
|
|
eventbridge
module
|
|
|
eventddb
module
|
|
|
events3
module
|
|
|
eventsqs
module
|
|
|
sqs
module
|
|
|
websocket
module
|
|
|
examples
|
|
|
eventbridge/recv
command
|
|
|
eventbridge/send
command
|
|
|
eventbridge/serverless
command
|
|
|
eventlog/dequeue
command
|
|
|
eventlog/enqueue
command
|
|
|
eventsqs/recv
command
|
|
|
eventsqs/send
command
|
|
|
eventsqs/serverless
command
|
|
|
sqs/recv
command
|
|
|
sqs/send
command
|
|
|
internal
|
|
|
qtest
module
|
|