MCPcopy Index your code
hub / github.com/riverqueue/river / QueuePauseTx

Method QueuePauseTx

client.go:2720–2736  ·  view source on GitHub ↗

QueuePauseTx pauses the queue with the given name. When a queue is paused, clients will not fetch any more jobs for that particular queue. To pause all queues at once, use the special queue name "*". Clients with a configured notifier should receive a notification about the paused queue(s) within a

(ctx context.Context, tx TTx, name string, opts *QueuePauseOpts)

Source from the content-addressed store, hash-verified

2718// used to cancel the operation or apply a timeout. The opts are reserved for
2719// future functionality.
2720func (c *Client[TTx]) QueuePauseTx(ctx context.Context, tx TTx, name string, opts *QueuePauseOpts) error {
2721 executorTx := c.driver.UnwrapExecutor(tx)
2722
2723 if err := executorTx.QueuePause(ctx, &riverdriver.QueuePauseParams{
2724 Name: name,
2725 Now: c.baseService.Time.NowOrNil(),
2726 Schema: c.config.Schema,
2727 }); err != nil {
2728 return err
2729 }
2730
2731 if _, err := c.notifyQueuePauseOrResume(ctx, executorTx, controlActionPause, name, opts); err != nil {
2732 return err
2733 }
2734
2735 return nil
2736}
2737
2738// QueueResume resumes the queue with the given name. If the queue was
2739// previously paused, any clients configured to work that queue will resume

Callers 1

Test_Client_CommonFunction · 0.80

Calls 4

UnwrapExecutorMethod · 0.65
QueuePauseMethod · 0.65
NowOrNilMethod · 0.65

Tested by 1

Test_Client_CommonFunction · 0.64