Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicInfo ¶
type BasicInfo int
BasicInfo is a set of flags describing properties of a basic type.
type Pile ¶
type Pile struct {
// contains filtered or unexported fields
}
Pile is a hybrid container for a lazily and concurrently populated growing-only slice of items (of type `uint`) which may be traversed in parallel to it's growth.
Usage for a pile `p`:
p := MakePile(128, 32)
Have it grow concurrently using multiple:
var item uint = something p.Pile(item)
in as many go routines as You may seem fit.
In parallel, You may either traverse `p` in parallel right away:
for item, ok := p.Iter(); ok; item, ok = p.Next() { ... do sth with item ... }
Here p.Iter() starts a new transversal with the first item (if any), and p.Next() keeps traverses the Pile.
or traverse blocking / awaiting close first:
for item := range <-p.Done() { ... do sth with item ... }
or use the result when available:
r, p := <-p.Done(), nil
Hint: here we get the result in `r` and at the same time discard / deallocate / forget the pile `p` itself.
Note: The traversal is *not* intended to be concurrency safe! Thus: You may call `Pile` concurrently to Your traversal, but use of either `Done` or `Iter` and `Next` *must* be confined to a single go routine (thread).
func MakePile ¶
MakePile returns a (pointer to a) fresh pile of items (of type `uint`) with size as initial capacity and with buff as initial leeway, allowing as many Pile's to execute non-blocking before respective Done or Next's.
func (*Pile) Close ¶
Close - call once when everything has been piled.
Close intentionally implements io.Closer ¶
Note: After Close(), any Close(...) will panic and any Pile(...) will panic and any Done() or Next() will return immediately: no eventual blocking, that is.
func (*Pile) Done ¶
Done returns a channel which emits the result (as slice of ) once the pile is closed.
Users of Done() *must not* iterate (via Iter() Next()...) before the done-channel is closed!
Done is a convenience - useful iff You do not like/need to start any traversal before the pile is fully populated. Once the pile is closed, Done() will signal in constant time.
Note: Upon signalling, the pile is reset to it's tip, so You may traverse it (via Next) right away. Usage for a pile `p`: Traverse blocking / awaiting close first:
for item := range <-p.Done() { ... do sth with item ... }
or use the result when available
r, p := <-p.Done(), nil
while discaring the pile itself.
func (*Pile) Iter ¶
Iter puts the pile iterator back to the beginning and returns the first `Next()`, iff any. Usage for a pile `p`:
for item, ok := p.Iter(); ok; item, ok = p.Next() { ... do sth with item ... }
type UInt16Pile ¶
type UInt16Pile struct {
// contains filtered or unexported fields
}
UInt16Pile is a hybrid container for a lazily and concurrently populated growing-only slice of items (of type `uint16`) which may be traversed in parallel to it's growth.
Usage for a pile `p`:
p := MakeUInt16Pile(128, 32)
Have it grow concurrently using multiple:
var item uint16 = something p.Pile(item)
in as many go routines as You may seem fit.
In parallel, You may either traverse `p` in parallel right away:
for item, ok := p.Iter(); ok; item, ok = p.Next() { ... do sth with item ... }
Here p.Iter() starts a new transversal with the first item (if any), and p.Next() keeps traverses the UInt16Pile.
or traverse blocking / awaiting close first:
for item := range <-p.Done() { ... do sth with item ... }
or use the result when available:
r, p := <-p.Done(), nil
Hint: here we get the result in `r` and at the same time discard / deallocate / forget the pile `p` itself.
Note: The traversal is *not* intended to be concurrency safe! Thus: You may call `Pile` concurrently to Your traversal, but use of either `Done` or `Iter` and `Next` *must* be confined to a single go routine (thread).
func MakeUInt16Pile ¶
func MakeUInt16Pile(size, buff int) *UInt16Pile
MakeUInt16Pile returns a (pointer to a) fresh pile of items (of type `uint16`) with size as initial capacity and with buff as initial leeway, allowing as many Pile's to execute non-blocking before respective Done or Next's.
func (*UInt16Pile) Close ¶
func (d *UInt16Pile) Close() (err error)
Close - call once when everything has been piled.
Close intentionally implements io.Closer ¶
Note: After Close(), any Close(...) will panic and any Pile(...) will panic and any Done() or Next() will return immediately: no eventual blocking, that is.
func (*UInt16Pile) Done ¶
func (d *UInt16Pile) Done() (done <-chan []uint16)
Done returns a channel which emits the result (as slice of UInt16) once the pile is closed.
Users of Done() *must not* iterate (via Iter() Next()...) before the done-channel is closed!
Done is a convenience - useful iff You do not like/need to start any traversal before the pile is fully populated. Once the pile is closed, Done() will signal in constant time.
Note: Upon signalling, the pile is reset to it's tip, so You may traverse it (via Next) right away. Usage for a pile `p`: Traverse blocking / awaiting close first:
for item := range <-p.Done() { ... do sth with item ... }
or use the result when available
r, p := <-p.Done(), nil
while discaring the pile itself.
func (*UInt16Pile) Iter ¶
func (d *UInt16Pile) Iter() (item uint16, ok bool)
Iter puts the pile iterator back to the beginning and returns the first `Next()`, iff any. Usage for a pile `p`:
for item, ok := p.Iter(); ok; item, ok = p.Next() { ... do sth with item ... }
func (*UInt16Pile) Next ¶
func (d *UInt16Pile) Next() (item uint16, ok bool)
Next returns the next item, or false iff the pile is exhausted.
Note: Iff the pile is not closed yet, Next may block, awaiting some Pile().
func (*UInt16Pile) Pile ¶
func (d *UInt16Pile) Pile(item uint16)
Pile appends an `uint16` item to the UInt16Pile.
Note: Pile will block iff buff is exceeded and no Done() or Next()'s are used.
type UInt32Pile ¶
type UInt32Pile struct {
// contains filtered or unexported fields
}
UInt32Pile is a hybrid container for a lazily and concurrently populated growing-only slice of items (of type `uint32`) which may be traversed in parallel to it's growth.
Usage for a pile `p`:
p := MakeUInt32Pile(128, 32)
Have it grow concurrently using multiple:
var item uint32 = something p.Pile(item)
in as many go routines as You may seem fit.
In parallel, You may either traverse `p` in parallel right away:
for item, ok := p.Iter(); ok; item, ok = p.Next() { ... do sth with item ... }
Here p.Iter() starts a new transversal with the first item (if any), and p.Next() keeps traverses the UInt32Pile.
or traverse blocking / awaiting close first:
for item := range <-p.Done() { ... do sth with item ... }
or use the result when available:
r, p := <-p.Done(), nil
Hint: here we get the result in `r` and at the same time discard / deallocate / forget the pile `p` itself.
Note: The traversal is *not* intended to be concurrency safe! Thus: You may call `Pile` concurrently to Your traversal, but use of either `Done` or `Iter` and `Next` *must* be confined to a single go routine (thread).
func MakeUInt32Pile ¶
func MakeUInt32Pile(size, buff int) *UInt32Pile
MakeUInt32Pile returns a (pointer to a) fresh pile of items (of type `uint32`) with size as initial capacity and with buff as initial leeway, allowing as many Pile's to execute non-blocking before respective Done or Next's.
func (*UInt32Pile) Close ¶
func (d *UInt32Pile) Close() (err error)
Close - call once when everything has been piled.
Close intentionally implements io.Closer ¶
Note: After Close(), any Close(...) will panic and any Pile(...) will panic and any Done() or Next() will return immediately: no eventual blocking, that is.
func (*UInt32Pile) Done ¶
func (d *UInt32Pile) Done() (done <-chan []uint32)
Done returns a channel which emits the result (as slice of UInt32) once the pile is closed.
Users of Done() *must not* iterate (via Iter() Next()...) before the done-channel is closed!
Done is a convenience - useful iff You do not like/need to start any traversal before the pile is fully populated. Once the pile is closed, Done() will signal in constant time.
Note: Upon signalling, the pile is reset to it's tip, so You may traverse it (via Next) right away. Usage for a pile `p`: Traverse blocking / awaiting close first:
for item := range <-p.Done() { ... do sth with item ... }
or use the result when available
r, p := <-p.Done(), nil
while discaring the pile itself.
func (*UInt32Pile) Iter ¶
func (d *UInt32Pile) Iter() (item uint32, ok bool)
Iter puts the pile iterator back to the beginning and returns the first `Next()`, iff any. Usage for a pile `p`:
for item, ok := p.Iter(); ok; item, ok = p.Next() { ... do sth with item ... }
func (*UInt32Pile) Next ¶
func (d *UInt32Pile) Next() (item uint32, ok bool)
Next returns the next item, or false iff the pile is exhausted.
Note: Iff the pile is not closed yet, Next may block, awaiting some Pile().
func (*UInt32Pile) Pile ¶
func (d *UInt32Pile) Pile(item uint32)
Pile appends an `uint32` item to the UInt32Pile.
Note: Pile will block iff buff is exceeded and no Done() or Next()'s are used.
type UInt64Pile ¶
type UInt64Pile struct {
// contains filtered or unexported fields
}
UInt64Pile is a hybrid container for a lazily and concurrently populated growing-only slice of items (of type `uint64`) which may be traversed in parallel to it's growth.
Usage for a pile `p`:
p := MakeUInt64Pile(128, 32)
Have it grow concurrently using multiple:
var item uint64 = something p.Pile(item)
in as many go routines as You may seem fit.
In parallel, You may either traverse `p` in parallel right away:
for item, ok := p.Iter(); ok; item, ok = p.Next() { ... do sth with item ... }
Here p.Iter() starts a new transversal with the first item (if any), and p.Next() keeps traverses the UInt64Pile.
or traverse blocking / awaiting close first:
for item := range <-p.Done() { ... do sth with item ... }
or use the result when available:
r, p := <-p.Done(), nil
Hint: here we get the result in `r` and at the same time discard / deallocate / forget the pile `p` itself.
Note: The traversal is *not* intended to be concurrency safe! Thus: You may call `Pile` concurrently to Your traversal, but use of either `Done` or `Iter` and `Next` *must* be confined to a single go routine (thread).
func MakeUInt64Pile ¶
func MakeUInt64Pile(size, buff int) *UInt64Pile
MakeUInt64Pile returns a (pointer to a) fresh pile of items (of type `uint64`) with size as initial capacity and with buff as initial leeway, allowing as many Pile's to execute non-blocking before respective Done or Next's.
func (*UInt64Pile) Close ¶
func (d *UInt64Pile) Close() (err error)
Close - call once when everything has been piled.
Close intentionally implements io.Closer ¶
Note: After Close(), any Close(...) will panic and any Pile(...) will panic and any Done() or Next() will return immediately: no eventual blocking, that is.
func (*UInt64Pile) Done ¶
func (d *UInt64Pile) Done() (done <-chan []uint64)
Done returns a channel which emits the result (as slice of UInt64) once the pile is closed.
Users of Done() *must not* iterate (via Iter() Next()...) before the done-channel is closed!
Done is a convenience - useful iff You do not like/need to start any traversal before the pile is fully populated. Once the pile is closed, Done() will signal in constant time.
Note: Upon signalling, the pile is reset to it's tip, so You may traverse it (via Next) right away. Usage for a pile `p`: Traverse blocking / awaiting close first:
for item := range <-p.Done() { ... do sth with item ... }
or use the result when available
r, p := <-p.Done(), nil
while discaring the pile itself.
func (*UInt64Pile) Iter ¶
func (d *UInt64Pile) Iter() (item uint64, ok bool)
Iter puts the pile iterator back to the beginning and returns the first `Next()`, iff any. Usage for a pile `p`:
for item, ok := p.Iter(); ok; item, ok = p.Next() { ... do sth with item ... }
func (*UInt64Pile) Next ¶
func (d *UInt64Pile) Next() (item uint64, ok bool)
Next returns the next item, or false iff the pile is exhausted.
Note: Iff the pile is not closed yet, Next may block, awaiting some Pile().
func (*UInt64Pile) Pile ¶
func (d *UInt64Pile) Pile(item uint64)
Pile appends an `uint64` item to the UInt64Pile.
Note: Pile will block iff buff is exceeded and no Done() or Next()'s are used.
type UInt8Pile ¶
type UInt8Pile struct {
// contains filtered or unexported fields
}
UInt8Pile is a hybrid container for a lazily and concurrently populated growing-only slice of items (of type `uint8`) which may be traversed in parallel to it's growth.
Usage for a pile `p`:
p := MakeUInt8Pile(128, 32)
Have it grow concurrently using multiple:
var item uint8 = something p.Pile(item)
in as many go routines as You may seem fit.
In parallel, You may either traverse `p` in parallel right away:
for item, ok := p.Iter(); ok; item, ok = p.Next() { ... do sth with item ... }
Here p.Iter() starts a new transversal with the first item (if any), and p.Next() keeps traverses the UInt8Pile.
or traverse blocking / awaiting close first:
for item := range <-p.Done() { ... do sth with item ... }
or use the result when available:
r, p := <-p.Done(), nil
Hint: here we get the result in `r` and at the same time discard / deallocate / forget the pile `p` itself.
Note: The traversal is *not* intended to be concurrency safe! Thus: You may call `Pile` concurrently to Your traversal, but use of either `Done` or `Iter` and `Next` *must* be confined to a single go routine (thread).
func MakeUInt8Pile ¶
MakeUInt8Pile returns a (pointer to a) fresh pile of items (of type `uint8`) with size as initial capacity and with buff as initial leeway, allowing as many Pile's to execute non-blocking before respective Done or Next's.
func (*UInt8Pile) Close ¶
Close - call once when everything has been piled.
Close intentionally implements io.Closer ¶
Note: After Close(), any Close(...) will panic and any Pile(...) will panic and any Done() or Next() will return immediately: no eventual blocking, that is.
func (*UInt8Pile) Done ¶
Done returns a channel which emits the result (as slice of UInt8) once the pile is closed.
Users of Done() *must not* iterate (via Iter() Next()...) before the done-channel is closed!
Done is a convenience - useful iff You do not like/need to start any traversal before the pile is fully populated. Once the pile is closed, Done() will signal in constant time.
Note: Upon signalling, the pile is reset to it's tip, so You may traverse it (via Next) right away. Usage for a pile `p`: Traverse blocking / awaiting close first:
for item := range <-p.Done() { ... do sth with item ... }
or use the result when available
r, p := <-p.Done(), nil
while discaring the pile itself.
func (*UInt8Pile) Iter ¶
Iter puts the pile iterator back to the beginning and returns the first `Next()`, iff any. Usage for a pile `p`:
for item, ok := p.Iter(); ok; item, ok = p.Next() { ... do sth with item ... }