You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pull() now returns Promise<T | undefined> instead of
Promise<PullResult<T> | undefined>. Also fixes README to match the
actual createQueue(handler, adapter, options?) signature.
Remove PullResult wrapper from queue adapter API. `pull` now returns `Promise<T | undefined>` instead of `Promise<PullResult<T> | undefined>`, matching the same simplification applied to @suckless/cache.
Creates a new queue. Workers start pulling immediately.
43
44
44
45
-`handler` — called for each item. May be sync or async.
45
-
-`options.adapter` — storage backend. Defaults to `memoryAdapter()`.
46
+
-`adapter` — a `QueueAdapter<T>` storage backend.
46
47
-`options.concurrency` — max concurrent handlers. Must be a positive finite integer. Defaults to `1`.
48
+
-`options.onError` — called when the handler throws. Receives the error and the item.
47
49
48
50
### `queue.push(item): Promise<void>`
49
51
@@ -62,7 +64,9 @@ Number of handlers currently executing.
62
64
The queue implements `AsyncDisposable`. Disposing marks the queue as closed, stops workers from pulling new items, waits for in-flight handlers, then disposes the adapter:
0 commit comments