Documentation
¶
Index ¶
- Constants
- func CallWithTimeout(ctx context.Context, timeout time.Duration, opName string, ...) error
- func ChannelBufferSize(env Env, def int) int
- func ChannelSendTimeout(env Env) time.Duration
- func ClientCallOptions(env Env, defaultRecv, defaultSend int) []grpc.CallOption
- func DialTimeout(env Env, def time.Duration) time.Duration
- func HangTimeout(env Env) time.Duration
- func HubCredentials(env Env) (credentials.TransportCredentials, error)
- func ListenLocalEndpoint(endpoint string) (net.Listener, error)
- func MessageTimeout(env Env, def time.Duration) time.Duration
- func RecvWithTimeout[T any](ctx context.Context, timeout time.Duration, opName string, ...) (T, error)
- func ServerOptions(env Env, defaultRecv, defaultSend int) []grpc.ServerOption
- func WaitForReady(ctx context.Context, conn *grpc.ClientConn) error
- type Config
- type Env
- type EnvFunc
- type RuntimeTunables
Constants ¶
const ( // DefaultHeartbeatInterval is the connector heartbeat interval used when the // binding payload does not provide an override. DefaultHeartbeatInterval = 30 * time.Second // DefaultLocalDialTimeout is the timeout for connector-to-local-runtime dials. DefaultLocalDialTimeout = 5 * time.Second // DefaultHubDialTimeout is the timeout for connector-to-hub dials. DefaultHubDialTimeout = 10 * time.Second )
const ( // DefaultMaxMessageSize is the fallback max receive/send message size for connector gRPC links. DefaultMaxMessageSize = 10 * 1024 * 1024 // DefaultChannelBufferSize is the fallback buffered channel depth for connector stream loops. DefaultChannelBufferSize = 16 // DefaultMessageTimeout is the fallback per-message timeout for connector runtime operations. DefaultMessageTimeout = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func CallWithTimeout ¶
func CallWithTimeout(ctx context.Context, timeout time.Duration, opName string, fn func(context.Context) error) error
CallWithTimeout executes fn with a derived context that carries the timeout. The callback should honor the provided context so any background work can unwind promptly after timeout or cancellation.
func ChannelBufferSize ¶
ChannelBufferSize resolves the buffered channel size used by stream loops.
func ChannelSendTimeout ¶
ChannelSendTimeout resolves the optional send timeout env.
func ClientCallOptions ¶
func ClientCallOptions(env Env, defaultRecv, defaultSend int) []grpc.CallOption
ClientCallOptions returns dialing call options derived from env overrides.
func DialTimeout ¶
DialTimeout resolves the shared GRPC dial timeout env with fallback.
func HangTimeout ¶
HangTimeout resolves the passive hang timeout env.
func HubCredentials ¶
func HubCredentials(env Env) (credentials.TransportCredentials, error)
HubCredentials builds TLS credentials from the shared env vars.
func ListenLocalEndpoint ¶
ListenLocalEndpoint normalizes tcp/unix endpoints and returns a listener.
func MessageTimeout ¶
MessageTimeout resolves the connector message timeout env.
func RecvWithTimeout ¶
func RecvWithTimeout[T any]( ctx context.Context, timeout time.Duration, opName string, fn func(context.Context) (T, error), ) (T, error)
RecvWithTimeout executes fn with a derived context that carries the timeout. The callback should honor the provided context so any background work can unwind promptly after timeout or cancellation.
func ServerOptions ¶
func ServerOptions(env Env, defaultRecv, defaultSend int) []grpc.ServerOption
ServerOptions returns standard gRPC server options derived from env overrides.
func WaitForReady ¶
func WaitForReady(ctx context.Context, conn *grpc.ClientConn) error
WaitForReady blocks until the connection reports connectivity.Ready or the context expires.
Types ¶
type Config ¶
type Config struct {
LocalEndpoint string
LocalServerName string
HubEndpoint string
StoryRunName string
Namespace string
StepID string
LocalDialTimeout time.Duration
HubDialTimeout time.Duration
Binding coretransport.BindingPayload
BindingHeartbeatInterval time.Duration
Generation int32
}
Config captures the ambient connector runtime settings.
func LoadConfigFromEnv ¶
LoadConfigFromEnv builds a Config from shared connector env vars.
type RuntimeTunables ¶
type RuntimeTunables struct {
MessageTimeout time.Duration
ChannelSendTimeout time.Duration
HangTimeout time.Duration
ChannelBufferSize int
}
RuntimeTunables captures connector/channel runtime knobs shared across repos.
func RuntimeTunablesFromEnv ¶
func RuntimeTunablesFromEnv(env Env, defaults RuntimeTunables) RuntimeTunables
RuntimeTunablesFromEnv resolves runtime knobs from env vars, falling back to the supplied defaults (or the package defaults when the provided values are zero). Env values always take precedence over defaults.