pool

package
v0.0.0-...-2c249d0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package pool implements a kite pool for staying connected to all matching kites in a query.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Pool

type Pool struct {
	sync.Mutex // protects Kites map
	// contains filtered or unexported fields
}

Pool is helper for staying connected to every kite in a query.

func New

func New(k *kite.Kite, q protocol.KontrolQuery) *Pool

func (*Pool) Get

func (p *Pool) Get() (*kite.Client, error)

Get returns a random connect kite from the pool.

func (*Pool) Len

func (p *Pool) Len() int

Len returns the number of total connected kites in the pool.

func (*Pool) Run

func (p *Pool) Run() error

Run the pool (blocking).

func (*Pool) Start

func (p *Pool) Start() chan error

Start the pool (unblocking).

Jump to

Keyboard shortcuts

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