fabric

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fabric

type Fabric interface {
	// Messenger is for async request/reply messaging with other services over the fabric.
	// Message receiving when the recipient is not connected is best-effort and not guaranteed.
	Messenger(service string) (MsgConnection, error)

	// Create a 'replayer', i.e. a pub/sub connection with ordered messages that durably persist in the fabric.
	// If 'beginning' is true, messages will be replayed from the "beginning of time".
	// If false, messages will only be played from the current time. If only publishing, pass false.
	Replayer(subject string, beginning bool) (ReplayConnection, error)
}

type Generator

type Generator func() any // function to generate objects for message unmarshalling

type Handler

type Handler func(msg any, replier Replier) // function for receiving messages and sending replies

type MsgConnection

type MsgConnection interface {
	SendAndRecv(msg any, receiver Receiver) error
	RecvAndReply(handler Handler)
}

type Receiver

type Receiver func(msg any) // function for receiving messages

type ReplayConnection

type ReplayConnection interface {
	Publish(msg any) error
	Replay(gen Generator, receiver Receiver) (chan bool, error)
}

type Replier

type Replier func(msg any) // function for sending message replies

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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