Documentation
¶
Index ¶
- Constants
- func LogDeadLetters[T any](out chan<- T, err <-chan T) chan<- T
- type Bag
- type Broker
- type CodecByte
- type CodecEvent
- type CodecJson
- type Config
- type Context
- type Event
- type EventKind
- type EventType
- type Msg
- type Option
- func WithConfigFromEnv() Option
- func WithLogStdErr() Option
- func WithNetworkTimeout(t time.Duration) Option
- func WithPolicyAtLeastOnce(n int) Option
- func WithPolicyAtMostOnce(n int) Option
- func WithPollFrequency(t time.Duration) Option
- func WithRetry(backoff Retry) Option
- func WithRetryConstant(t time.Duration, n int) Option
- func WithRetryExponential(t time.Duration, n int, f float64) Option
- func WithRetryLinear(t time.Duration, n int) Option
- func WithRetryNo() Option
- func WithService(service any) Option
- func WithSource(agent string) Option
- func WithStdErr(stderr chan<- error) Option
- func WithTimeToFlight(t time.Duration) Option
- type Policy
- type Retry
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func LogDeadLetters ¶ added in v0.13.0
func LogDeadLetters[T any](out chan<- T, err <-chan T) chan<- T
Consumes dead letter messages
swarm.LogDeadLetters(queue.Enqueue(...))
Types ¶
type Bag ¶ added in v0.4.0
Bag is an abstract container for octet stream. Bag is used by the transport to abstract message on the wire.
type CodecByte ¶ added in v0.13.3
type CodecByte struct{}
Byte identity codec for I/O kernet
func NewCodecByte ¶ added in v0.13.3
func NewCodecByte() CodecByte
type CodecEvent ¶ added in v0.13.3
Event codec for I/O kernel
func NewCodecEvent ¶ added in v0.13.3
func NewCodecEvent[T any, E EventKind[T]](source, cat string) CodecEvent[T, E]
func (CodecEvent[T, E]) Decode ¶ added in v0.13.3
func (c CodecEvent[T, E]) Decode(b []byte) (*E, error)
func (CodecEvent[T, E]) Encode ¶ added in v0.13.3
func (c CodecEvent[T, E]) Encode(obj *E) ([]byte, error)
type CodecJson ¶ added in v0.13.3
type CodecJson[T any] struct{}
Json codec for I/O kernel
func NewCodecJson ¶ added in v0.13.3
type Config ¶
type Config struct {
// Instance of AWS Service, used to overwrite default client
Service any
// Source is a direct performer of the event.
// A software service that emits action to the stream.
Source string
// Quality of Service Policy
Policy Policy
// Queue capacity (enhance with individual capacities)
CapOut int
CapDLQ int
CapRcv int
CapAck int
// Retry Policy for service calls
Backoff Retry
// Standard Error I/O channel
StdErr chan<- error
// Frequency to poll broker api
PollFrequency time.Duration
// Time To Flight is a time required by the client to acknowledge the message
TimeToFlight time.Duration
// Timeout for any network operations
NetworkTimeout time.Duration
}
type Context ¶ added in v0.13.3
type Context struct {
context.Context
// Message category ~ topic
Category string
// Unique brief summary of the message
Digest string
// Error on the message processing
Error error
}
Global context for the message
type Event ¶ added in v0.5.0
type Event[T any] struct { // // Unique identity for event // It is automatically defined by the library upon the transmission ID string `json:"id,omitempty"` // // Canonical IRI that defines a type of action. // It is automatically defined by the library upon the transmission Type curie.IRI `json:"type,omitempty"` // // Direct performer of the event, a software service that emits action to the stream. // It is automatically defined by the library upon the transmission 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 // It is automatically defined by the library upon the transmission Created time.Time `json:"created,omitempty"` // // 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 Option ¶ added in v0.9.0
type Option func(conf *Config)
Configuration option for queueing broker
func WithConfigFromEnv ¶ added in v0.13.2
func WithConfigFromEnv() Option
Configure from Environment, (all timers in seconds) - CONFIG_SWARM_POLL_FREQUENCY - CONFIG_SWARM_TIME_TO_FLIGHT - CONFIG_SWARM_NETWORK_TIMEOUT
func WithLogStdErr ¶ added in v0.13.0
func WithLogStdErr() Option
Configure broker to log standard errors
func WithNetworkTimeout ¶ added in v0.9.0
Timeout for Network I/O
func WithPolicyAtLeastOnce ¶ added in v0.9.0
AtLeastOnce policy ensures delivery of the message to broker
The policy only impacts behavior of Golang channels created by the broker
func WithPolicyAtMostOnce ¶ added in v0.9.0
AtMostOnce is best effort policy, where a message is published without any formal acknowledgement of receipt, and it isn't replayed.
The policy only impacts behavior of Golang channels created by the broker
func WithPollFrequency ¶ added in v0.9.0
Frequency to poll broker api
func WithRetryConstant ¶ added in v0.9.0
Retry operation for N times, with T wait time in between
func WithRetryExponential ¶ added in v0.9.0
Retry operation for N times, with exponential increments by T on each step
func WithRetryLinear ¶ added in v0.9.0
Retry operation for N times, with linear increments by T on each step
func WithService ¶ added in v0.9.0
Configure AWS Service for broker instance
func WithSource ¶ added in v0.9.0
Source is a direct performer of the event. A software service that emits action to the stream.
func WithStdErr ¶ added in v0.9.0
Configure broker to route global errors to channel
func WithTimeToFlight ¶ added in v0.9.0
Time To Flight for message from broker API to consumer
Directories
¶
| Path | Synopsis |
|---|---|
|
broker
|
|
|
websocket/lambda/auth
command
|
|
|
websocket/lambda/connector
command
|
|
|
embedded
module
|
|
|
examples
|
|
|
bytes/dequeue
command
|
|
|
bytes/enqueue
command
|
|
|
eventbridge/dequeue
command
|
|
|
eventbridge/enqueue
command
|
|
|
eventbridge/serverless
command
|
|
|
eventddb/dequeue
command
|
|
|
eventddb/serverless
command
|
|
|
events/dequeue
command
|
|
|
events/enqueue
command
|
|
|
events3/dequeue
command
|
|
|
events3/serverless
command
|
|
|
eventsqs/dequeue
command
|
|
|
eventsqs/enqueue
command
|
|
|
eventsqs/serverless
command
|
|
|
sqs/dequeue
command
|
|
|
sqs/enqueue
command
|
|
|
websocket/dequeue
command
|
|
|
websocket/serverless
command
|
|
|
internal
|
|
|
qtest
module
|
|