embedded

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingHandler            = errors.New("missing handler")
	ErrClientClosed              = errors.New("client closed")
	ErrNegativeBufferSize        = errors.New("buffer size cannot be negative")
	ErrNonPositiveHandlerTimeout = errors.New("handler timeout must be greater than 0")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a implementation of the orbital.Initiator interface.

func NewClient

func NewClient(h orbital.HandlerFunc, opts ...Option) (*Client, error)

NewClient creates a new embedded Client instance. It expects a handler which is used to process task requests and generate task responses. It allows options to configure the buffer size of the link channel and the timeout for the handler.

func (*Client) Close

func (c *Client) Close(_ context.Context) error

Close closes the link channel.

func (*Client) ReceiveTaskResponse

func (c *Client) ReceiveTaskResponse(ctx context.Context) (orbital.TaskResponse, error)

ReceiveTaskResponse waits for a task response.

func (*Client) SendTaskRequest

func (c *Client) SendTaskRequest(ctx context.Context, request orbital.TaskRequest) error

SendTaskRequest passes the task request to the handler which processes the request asynchronously.

type Option

type Option func(*config) error

Option is a function type that modifies the configuration of the Client.

func WithBufferSize added in v0.5.0

func WithBufferSize(size int) Option

WithBufferSize sets the buffer size of the link channel.

func WithHandlerTimeout added in v0.5.0

func WithHandlerTimeout(timeout time.Duration) Option

WithHandlerTimeout sets the timeout for the handler.

Jump to

Keyboard shortcuts

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