pooling

package module
v0.0.0-...-5691733 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

pooling

pooling for gorotine

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPool

type IPool interface {
	Submit(task func())
	Release()
	Running() int
}

IPool - pooling interface

type MockedGPoolingImpl

type MockedGPoolingImpl struct {
}

MockedGPoolingImpl - mocking

func (*MockedGPoolingImpl) Release

func (p *MockedGPoolingImpl) Release()

Release - release all gorotine

func (*MockedGPoolingImpl) Running

func (p *MockedGPoolingImpl) Running() int

Running - returns the number of the currently running goroutines.

func (*MockedGPoolingImpl) Submit

func (p *MockedGPoolingImpl) Submit(task func())

Submit - submit a task to this pool

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool - pooling struct

func Init

func Init(maxPoolSize int, logger logger.ILogger) (*Pool, error)

Init - init pooling

func (*Pool) Release

func (p *Pool) Release()

Release - release all gorotine

func (*Pool) Running

func (p *Pool) Running() int

Running - returns the number of the currently running goroutines.

func (*Pool) Submit

func (p *Pool) Submit(task func())

Submit - submit a task to this pool

Jump to

Keyboard shortcuts

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