Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StrPtrEq ¶
Check two string pointers for equality as follows: - If neither pointer is nil, check equality of the underlying strings. - If either pointer is nil, return true if and only if they both are.
func Uint16PtrEq ¶
Check two uint16 pointers for equality as follows: - If neither pointer is nil, check equality of the underlying uint16s. - If either pointer is nil, return true if and only if they both are.
Types ¶
type ElasticChan ¶
type ElasticChan struct {
In chan interface{}
Out chan interface{}
// contains filtered or unexported fields
}
A dynamic channel that does not block on send, but has an unlimited buffer capacity. ElasticChan uses a dynamic slice to buffer signals received on the input channel until the output channel is ready to process them.
func (*ElasticChan) Init ¶
func (c *ElasticChan) Init()
Initialise the Elastic channel, and start the management goroutine.
type Semaphore ¶
type Semaphore interface {
// Take a semaphore lock.
Acquire()
// Release an acquired semaphore lock.
// This should only be called when the semaphore is blocked, otherwise behaviour is undefined
Release()
// Block execution until the semaphore is free.
Wait()
// Clean up the semaphore object.
Dispose()
}
Simple semaphore implementation. Any number of calls to Acquire() can be made; these will not block. If the semaphore has been acquired more times than it has been released, it is called 'blocked'. Otherwise, it is called 'free'.
func NewSemaphore ¶
func NewSemaphore() Semaphore