IISerialAsyncOperationQueue
A serial queue supporting async operations. The next operation starts only after the previous one completes.
Install / Use
/learn @Inferis/IISerialAsyncOperationQueueREADME
IISerialAsyncOperationQueue
A serial queue supporting async operations. The next operation starts only after the previous one completes.
This is the same as simple serial NSOperationQueue, but this one is geared towards async operations which is a bit harder to do with a plain old NSOperationQueue.
Usage
Using this component is pretty simple. You create an instance and then add operations to it.
There's two actions possible:
setOperation:: adds the operation to the queue but also removes all pending operations. The currently executing operation (if any) will continue until it is complete, after that the added operation is run. This call effectively clears all previously added operations replacing them with the new operation.addOperation:: adds the operation to the queue and leave all other pending operations be. All operations will be executed in the order they were passed. The added operation will only be run after all other queued operations are completed.
Either way, if no operations are pending, the operation will be run immediately.
For example:
IISerialAsyncOperationQueue *queue = [IISerialAsyncOperationQueue new];
[queue addOperation:^(id<IISerialAsyncOperation> operation) {
[do somethingAsync:^{
[operation finish];
}];
}];
License
IISerialOperationQueue is published under the MIT License.
See LICENSE for the full license.
Related Skills
openhue
343.3kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
343.3kElevenLabs text-to-speech with mac-style say UX.
weather
343.3kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
