Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue interface { // BeginRead locks queue for Scan. // Must be called before Scan. BeginRead(ctx context.Context) error // Push calls StringConverter.ToString and adds result to the queue. // Non-blocking. Push(ctx context.Context, t StringConverter) error // Scan gets next queue element and put it into StringConverter.FromString. // Element remain in queue. Scan(ctx context.Context, t StringConverter) error // Commit removes elements from queue and unlocks it. // Must call after sequence of Scan. Commit(ctx context.Context) error // Rollback move element into end of queue and unlocks it. // Must call after sequence of Scan. Rollback(ctx context.Context) error // Cancel breaks transaction. Elements remains in queue. // Must call after sequence of Scan. Cancel(ctx context.Context) error }
func NewSeqQueue ¶
func NewSeqQueue(cfg *QueueConfig) (Queue, error)
type QueueConfig ¶
type QueueConfig struct { Conn redis.UniversalClient // Name is the name of queue. // Don't use same name in some queues. Name string // Typ is the type of queue Typ StringConverter BeginMode BeginMode }
Click to show internal directories.
Click to hide internal directories.