MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / Tick

Method Tick

asyncbuffer/cond.go:27–36  ·  view source on GitHub ↗

Tick signals that an event has occurred by closing the channel and incrementing cursor.

()

Source from the content-addressed store, hash-verified

25
26// Tick signals that an event has occurred by closing the channel and incrementing cursor.
27func (t *Cond) Tick() {
28 t.mu.Lock()
29 defer t.mu.Unlock()
30
31 if t.ch != nil {
32 t.cursor.Add(1) // Increment FIRST so waiters see new cursor when they wake
33 close(t.ch) // Then close channel to wake waiters
34 t.ch = make(condCh) // Create new channel for next Tick
35 }
36}
37
38// Cursor returns the current cursor value.
39// Capture this before checking your condition, then pass it to Wait().

Callers 5

TestBasicWaitAndTickMethod · 0.80
TestCloseMethod · 0.80
addChunkMethod · 0.80

Calls 1

AddMethod · 0.80

Tested by 4

TestBasicWaitAndTickMethod · 0.64
TestCloseMethod · 0.64