service

package
v0.0.0-...-89602ce Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

package service implements the core of bootstrapper

Index

Constants

View Source
const (
	// grpc message is delivered as a length prefixed message within the HTTP2 DATA
	// frames, with first 5 bytes for compression and msg length
	// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
	GRPC_MSGLEN_SZ  = 5
	GRPC_LEN_OFFSET = 1

	MinRetryInterval      = time.Millisecond * 500
	MaxRetryInterval      = time.Second * 30
	RetryBackoffIncrement = MinRetryInterval
	SuccessStartInterval  = time.Second * 5

	DefaultSyncRpcHeartbeatInterval = time.Second * 30
	DefaultGatewayKeepaliveInterval = time.Second * 10
	DefaultGatewayResponseTimeout   = time.Second * 120
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Sync rpc client sends across heartbeat responses with empty reqID
	// in case no messages were sent within this interval(in seconds)
	SyncRpcHeartbeatInterval time.Duration `yaml:"sync_rpc_heartbeat_interval"`

	// Sync rpc client sends across gateway response with KeepConnActive
	// flag set in case it doesn't receive any responses from gateway service
	// within this interval(in seconds)
	GatewayKeepaliveInterval time.Duration `yaml:"gateway_keepalive_interval"`

	// Sync rpc client sends across a gateway timed out error response to
	// dispatcher in case it doesn't receive any responses from gateway service
	// within timeout period(in seconds)
	GatewayResponseTimeout time.Duration `yaml:"gateway_response_timeout"`
}

type Request

type Request struct {
	CancelFunc context.CancelFunc
	// contains filtered or unexported fields
}

Request - outstanding request

type SyncRpcClient

type SyncRpcClient struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SyncRpcClient opens a bidirectional connection with the cloud

func NewClient

NewClient returns a new SyncRPC client using given service registry If given registry is nil - use shared GW Service Registry config values

func (*SyncRpcClient) Run

func (c *SyncRpcClient) Run()

Run starts SyncRPC worker loop and block forever

Jump to

Keyboard shortcuts

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