syncasync

package
v0.0.0-...-93e01a0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge interface {
	// Init is required as there's a bi-directional relationship between sysmessaging and syncasync bridge
	Init(sysevents sysmessaging.SystemEvents)
	// Request performs a request/reply exchange taking a message as input, and returning a message as a response
	// The input message must have a tag, and a group, to be routed appropriately.
	RequestReply(ctx context.Context, ns string, send RequestSender) (*fftypes.MessageInOut, error)
	// SendConfirm blocks until the message is confirmed (or rejected), but does not look for a reply.
	SendConfirm(ctx context.Context, ns string, send RequestSender) (*fftypes.Message, error)
	// SendConfirmTokenPool blocks until the token pool is confirmed (or rejected)
	SendConfirmTokenPool(ctx context.Context, ns string, send RequestSender) (*fftypes.TokenPool, error)
}

Bridge translates synchronous (HTTP API) calls, into asynchronously sending a message and blocking until a correlating response is received, or we hit a timeout.

func NewSyncAsyncBridge

func NewSyncAsyncBridge(ctx context.Context, di database.Plugin, dm data.Manager) Bridge

type RequestSender

type RequestSender func(requestID *fftypes.UUID) error

Jump to

Keyboard shortcuts

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