Documentation ¶
Overview ¶
Package net implements the network layer for go-threads. Nodes exchange messages with each other via gRPC, and the format is defined under /pb.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DialTimeout is the max time duration to wait when dialing a peer. DialTimeout = time.Second * 20 PushTimeout = time.Second * 20 PullTimeout = time.Second * 20 )
View Source
var ( // MaxThreadsExchanged is the maximum number of threads for the single edge exchange. MaxThreadsExchanged = 2 // 2 is the minimum number of threads for the exchange to work for app // ExchangeCompressionTimeout is the maximum duration of collecting threads for the exchange edges request. ExchangeCompressionTimeout = PullTimeout / 2 // QueuePollInterval is the polling interval for the call queue. QueuePollInterval = time.Millisecond * 500 // EventBusCapacity is the buffer size of local event bus listeners. EventBusCapacity = 1 )
Functions ¶
func NewNetwork ¶
func NewNetwork( ctx context.Context, h host.Host, bstore bs.Blockstore, ds format.DAGService, ls lstore.Logstore, conf Config, serverOptions []grpc.ServerOption, dialOptions []grpc.DialOption, threadExtern core.ThreadExternal, ) (app.Net, error)
NewNetwork creates an instance of net from the given host and thread store.
Types ¶
type Config ¶
type Config struct { NetPullingLimit uint NetPullingStartAfter time.Duration NetPullingInitialInterval time.Duration NetPullingInterval time.Duration NoNetPulling bool NoExchangeEdgesMigration bool PubSub bool Debug bool }
Config is used to specify thread instance options.
Click to show internal directories.
Click to hide internal directories.