Documentation
¶
Overview ¶
Package direct is the SDK's side of backplane's direct runtime: the ActivityService that lets backplane run the service's activities over gRPC on the platform port, and the hook Caller that reaches backplane's HookService the same way. Both carry the envelopes Temporal carries; neither needs it.
Index ¶
Constants ¶
const ( NonRetryableType = "backplane.NonRetryable" PanicType = "backplane.Panic" )
Failure types of a direct call, as the binding knows them.
const KeyHeader = "bp-call-key"
KeyHeader carries the call's idempotency key (hook.Key) to backplane.
const NoBindingType = "backplane.NoBinding"
NoBindingType is the failure type of a required hook without a binding.
Variables ¶
This section is empty.
Functions ¶
func FailureOf ¶
FailureOf reads the CallFailure of a status error: its type and whether retrying can help; retryable (and no type) when it has none, as a transport error is.
Types ¶
type Caller ¶
type Caller struct {
// contains filtered or unexported fields
}
Caller carries hook calls to backplane's HookService: env.Caller for the direct transport. A call goes to one replica; UNAVAILABLE from it tries another once.
func (*Caller) Call ¶
Call implements env.Caller: HookService.Call on a replica of backplane, within ctx's deadline (the configured timeout when it has none). The error is env.ErrNoBinding, env.ErrUnavailable (no replica, none reachable), context.DeadlineExceeded, or the run's failure with its message.
type CallerParams ¶
type CallerParams struct {
Service string
Instance string
// Secret is the installation's internal secret, presented to backplane.
Secret string
// Timeout of a call nothing else bounds; 0 is env.DefaultHookTimeout.
Timeout time.Duration
Discovery Discovery
// Dial replaces the gRPC dial (tests).
Dial func(addr string) (*grpc.ClientConn, error)
}
CallerParams builds a Caller.
type Discovery ¶
Discovery finds the platform addresses (host:port) of backplane's replicas; none means backplane is not known to be running.
type DiscoveryFunc ¶
DiscoveryFunc adapts a function.
func (DiscoveryFunc) Backplanes ¶
func (f DiscoveryFunc) Backplanes(ctx context.Context) ([]string, error)
Backplanes implements Discovery.
type Server ¶
type Server struct {
backplanev1.UnimplementedActivityServiceServer
// contains filtered or unexported fields
}
Server serves ActivityService: the handlers activity.Handle registered in the env.
func (*Server) Run ¶
func (s *Server) Run(ctx context.Context, req *backplanev1.RunRequest) (*backplanev1.RunResponse, error)
Run implements ActivityService.