request

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 11 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

Overview

Package request is the request primitive shared by the public call helper and the protocol engine's inbound bridge: one request sent through addressed access with a fresh return capability that carries its invocation lifecycle, and the wait for its one response.

Index

Constants

View Source
const DefaultTimeout = 30 * time.Second

DefaultTimeout is how long a call waits for its response when it states no deadline of its own.

Variables

This section is empty.

Functions

func Await

func Await(ctx context.Context, reply <-chan Result, done <-chan struct{}, ended func() error, result any) (bool, error)

Await is the request primitive shared by carriers and addressed access: it waits for the response, the context's end or the carrier's end. The first result says whether the caller withdrew, so a cancellation is owed.

func Call

func Call(ctx context.Context, access wire.AddressedWire, path []string, params, result any, dispatch *delivery.Context, options Options) error

Call sends one request at path through access and waits for its response. dispatch is the context a carrier established when this call forwards a request it admitted; it is nil for an application's own call.

Types

type Options

type Options struct {
	Propagator core.Propagator
	Timeout    time.Duration
}

Options configures one call. A zero Timeout uses DefaultTimeout; a nil Propagator uses core.DefaultPropagator.

type Reply

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

Reply is the return capability of one call. Its empty path takes the response; every other path is its invocation's lifecycle vocabulary.

func Own added in v0.4.1

func Own(message wire.Message) (*Reply, bool)

Own is the return capability of an application's own call, if message carries one: a Reply that no carrier established. A peer whose deadline for such a call passes fails it locally with Expire; any other return may cross a wire and is answered.

func (*Reply) BitruntimeDelivery

func (w *Reply) BitruntimeDelivery() *delivery.Context

BitruntimeDelivery is the context the carrier established, if any.

func (*Reply) Expire added in v0.4.1

func (w *Reply) Expire(err error) error

Expire settles the call with err and no response. bitwire/1 fails a call locally when its caller's deadline passes: that error is the caller's own and never a frame.

func (*Reply) Invocation

func (w *Reply) Invocation() *core.Invocation

Invocation exposes this return capability's lifecycle to its owner.

func (*Reply) Send

func (w *Reply) Send(path []string, message wire.Message) error

type Result

type Result struct {
	Value json.RawMessage
	Err   error
}

Result is one response as a waiter receives it.

Jump to

Keyboard shortcuts

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