pool

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CName = "common.net.pool"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool interface {
	// Get lookups to peer in existing connections or creates and cache new one
	Get(ctx context.Context, id string) (peer.Peer, error)
	// Dial creates new connection to peer and not use cache
	Dial(ctx context.Context, id string) (peer.Peer, error)
	// GetOneOf searches at least one existing connection in cache or creates a new one from a randomly selected id from given list
	GetOneOf(ctx context.Context, peerIds []string) (peer.Peer, error)

	DialOneOf(ctx context.Context, peerIds []string) (peer.Peer, error)
}

Pool creates and caches outgoing connection

type Service

type Service interface {
	Pool
	NewPool(name string) Pool
	app.ComponentRunnable
}

func New

func New() Service

Jump to

Keyboard shortcuts

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