Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for NewDelayed (0.07 sec)

  1. pkg/queue/delay_test.go

    			t.Fatalf("pop %d was not in order", i)
    		}
    		if peeked != popped {
    			t.Fatalf("did not peek at the next item to be popped")
    		}
    	}
    }
    
    func TestDelayQueueOrdering(t *testing.T) {
    	dq := NewDelayed(DelayQueueWorkers(2))
    	stop := make(chan struct{})
    	defer close(stop)
    	go dq.Run(stop)
    
    	mu := sync.Mutex{}
    	var t0, t1, t2 time.Time
    
    	done := make(chan struct{})
    	dq.PushDelayed(func() error {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jul 20 06:27:31 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  2. pkg/queue/delay.go

    	//
    	// GOMAXPROCS determines how many goroutines can run in parallel,
    	// which makes it the best choice as the channel capacity,
    	return n
    }()
    
    // NewDelayed gives a Delayed queue with maximum concurrency specified by workers.
    func NewDelayed(opts ...DelayQueueOption) Delayed {
    	q := &delayQueue{
    		workers: 1,
    		queue:   &pq{},
    		execute: make(chan *delayTask, workerChanBuf),
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jul 20 06:27:31 UTC 2023
    - 6.7K bytes
    - Viewed (0)
Back to top