Documentation
¶
Index ¶
- func Compose[T, U, V any](f func(T) U, g func(U) V) func(T) V
- func Error1st(ef []func() error) error
- func ErrorFromBool(ok bool, ng func() error) error
- func IfNg(ng error, f func())
- func IterReduce[T, U any](i Iter[T], init U, reducer func(state U, item T) U) U
- func IterReduceFilter[T, U any](i Iter[T], init U, filter func(T) bool, reducer func(state U, item T) U) U
- func MustOk[T any](t T, e error) T
- func PopLast[T any](s []T) []T
- type Add
- type Cls
- type Cnt
- type Codec
- type Counter
- type Del
- type Get
- type Id
- type Iter
- type Lmt
- type Msg
- type Option
- type Pack
- type Queue
- func (q Queue) Close() error
- func (q Queue) Pop(ctx context.Context, cb func(context.Context, Msg) error) error
- func (q Queue) PopMany(ctx context.Context, codec Codec, cb func(context.Context, []Msg) error) error
- func (q Queue) Push(ctx context.Context, data []byte) error
- func (q Queue) PushMany(ctx context.Context, messages []Msg, codec Codec) error
- type QueueBuilder
- type Unpack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorFromBool ¶
func IterReduce ¶
func IterReduceFilter ¶
Types ¶
type Id ¶
type Id struct {
// contains filtered or unexported fields
}
Id is unique queue identifier.
type Iter ¶
func IterFromArray ¶
type Msg ¶
type Msg struct {
// contains filtered or unexported fields
}
Msg is queue data with identifier.
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
func OptionEmpty ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func MemQueueNew ¶
func (Queue) Pop ¶
Pop gets msg and remove it if client received. 1. try get msg 2. call callback cb and send msg 3. if callback recv msg, try remove queue
func (Queue) PopMany ¶
func (q Queue) PopMany(ctx context.Context, codec Codec, cb func(context.Context, []Msg) error) error
PopMany pop many messages from single virtual msg.
type QueueBuilder ¶
func (QueueBuilder) Build ¶
func (b QueueBuilder) Build() (q Queue, e error)
Click to show internal directories.
Click to hide internal directories.