syncasync

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 event manager and syncasync bridge
	Init(sysevents system.EventInterface)

	// WaitForReply waits for a reply to the message with the supplied ID
	WaitForReply(ctx context.Context, id *fftypes.UUID, send SendFunction) (*core.MessageInOut, error)
	// WaitForMessage waits for a message with the supplied ID
	WaitForMessage(ctx context.Context, id *fftypes.UUID, send SendFunction) (*core.Message, error)
	// WaitForIdentity waits for an identity with the supplied ID
	WaitForIdentity(ctx context.Context, id *fftypes.UUID, send SendFunction) (*core.Identity, error)
	// WaitForTokenPool waits for a token pool with the supplied ID
	WaitForTokenPool(ctx context.Context, id *fftypes.UUID, send SendFunction) (*core.TokenPool, error)
	// WaitForTokenTransfer waits for a token transfer with the supplied ID
	WaitForTokenTransfer(ctx context.Context, id *fftypes.UUID, send SendFunction) (*core.TokenTransfer, error)
	// WaitForTokenTransfer waits for a token approval with the supplied ID
	WaitForTokenApproval(ctx context.Context, id *fftypes.UUID, send SendFunction) (*core.TokenApproval, error)
	// WaitForInvokeOperation waits for an operation with the supplied ID
	WaitForInvokeOperation(ctx context.Context, id *fftypes.UUID, send SendFunction) (*core.Operation, error)
	// WaitForDeployOperation waits for an operation with the supplied ID
	WaitForDeployOperation(ctx context.Context, id *fftypes.UUID, send SendFunction) (*core.Operation, 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, ns string, di database.Plugin, dm data.Manager, om operations.Manager) Bridge

type SendFunction

type SendFunction func(ctx context.Context) error

type Sender

type Sender interface {
	Prepare(ctx context.Context) error
	Send(ctx context.Context) error
	SendAndWait(ctx context.Context) error
}

Sender interface may be implemented by other types that wish to provide generic sync/async capabilities

Jump to

Keyboard shortcuts

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