queue

package
v2.3.7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountCurrentJobs

func CountCurrentJobs() int

CountCurrentJobs will return the number of current pending/queued jobs

func NewListCommand

func NewListCommand(base bot.BaseCommand) bot.Command

NewListCommand prints the list of all queued commands (blocking commands like running Jenkins jobs)

func NewQueueCommand

func NewQueueCommand(base bot.BaseCommand) bot.Command

NewQueueCommand is able to execute a command when another blocking process is done e.g. have a running jenkins job and using "then reply done!" to get a information later

func WaitTillHavingNoQueuedMessage added in v2.3.3

func WaitTillHavingNoQueuedMessage()

WaitTillHavingNoQueuedMessage will wait in test context until all background tasks are done. we use a deadline of 2s until we mark the test as failed

Types

type RunningCommand

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

RunningCommand is a wrapper to sync.WaitGroup to control the behavior of a running command: - when the command is done, call the Done() method - listener can register via Wait() method which is blocking until command is done

func AddRunningCommand

func AddRunningCommand(message msg.Message, fallbackCommand string) *RunningCommand

AddRunningCommand registers a long running command, e.g. a running Jenkins job or watching a pull request it's doing following magic: - when using "trigger job XXX" and "then reply done" it will execute the "reply done" when the running command was finished - when the server got restarted, the fallbackCommand gets executed

func (*RunningCommand) Done

func (r *RunningCommand) Done()

Done will finish the sync.WaitGroup and releases the lock for Done()

func (*RunningCommand) Wait

func (r *RunningCommand) Wait()

Wait blocks until command is Done()

Jump to

Keyboard shortcuts

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