queue

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Push

func Push[E any](ctx context.Context, log *slog.Logger, client valkeygo.Client, queueName string, value E) error

Push allows adding a value to the queue which will then be delivered to the waiters. messages will only be received by one waiter which waits for the given queueName.

func Wait

func Wait[E any](ctx context.Context, log *slog.Logger, client valkeygo.Client, queueName string) <-chan E

Wait receives values from the queue with the given queueName, every value in the queue not already consumed will be returned. when the context is done, the channel gets closed.

Types

type Queue

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

func New

func New(log *slog.Logger, client valkeygo.Client) *Queue

func (*Queue) PushMachineAllocation

func (q *Queue) PushMachineAllocation(ctx context.Context, machineId string, allocation task.MachineAllocationPayload) error

func (*Queue) PushMachineCommand

func (q *Queue) PushMachineCommand(ctx context.Context, partition string, command task.MachineBMCCommandPayload) error

func (*Queue) PushMachineCommandDone

func (q *Queue) PushMachineCommandDone(ctx context.Context, commandId string, command task.BMCCommandDonePayload) error

func (*Queue) WaitMachineAllocation

func (q *Queue) WaitMachineAllocation(ctx context.Context, machineId string) <-chan task.MachineAllocationPayload

func (*Queue) WaitMachineCommand

func (q *Queue) WaitMachineCommand(ctx context.Context, partition string) <-chan task.MachineBMCCommandPayload

func (*Queue) WaitMachineCommandDone

func (q *Queue) WaitMachineCommandDone(ctx context.Context, commandId string) <-chan task.BMCCommandDonePayload

Jump to

Keyboard shortcuts

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