syncasync

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 10 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)

	// WaitForReply waits for a reply to the message with the supplied ID
	WaitForReply(ctx context.Context, ns string, id *fftypes.UUID, send RequestSender) (*fftypes.MessageInOut, error)
	// WaitForMessage waits for a message with the supplied ID
	WaitForMessage(ctx context.Context, ns string, id *fftypes.UUID, send RequestSender) (*fftypes.Message, error)
	// WaitForTokenPool waits for a token pool with the supplied ID
	WaitForTokenPool(ctx context.Context, ns string, id *fftypes.UUID, send RequestSender) (*fftypes.TokenPool, error)
	// WaitForTokenTransfer waits for a token transfer with the supplied ID
	WaitForTokenTransfer(ctx context.Context, ns string, id *fftypes.UUID, send RequestSender) (*fftypes.TokenTransfer, 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(ctx context.Context) error

Jump to

Keyboard shortcuts

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