A MulleInvocationQueue is fed with NSInvocations, which it then executes in serial fashion in a separate thread.
Release Version | Release Notes |
---|---|
RELEASENOTES |
You create a queue on your current thread
queue = [MulleInvocationQueue alloc];
queue = [queue initWithCapacity:128
configuration:MulleInvocationQueueMessageDelegateOnExecutionThread];
queue = [queue autorelease];
Then you feed the invocation queue with invocations still from your thread. These invocations need not be to methods, written in a threadsafe manner, as long as the target is now exclusively used by the MulleInvocationQueue until all invocations are processed:
invocation = [NSInvocation mulleInvocationWithTarget:foo
selector:@selector( printUTF8String:), s];
[queue addInvocation:invocation];
It is not necessary, but it will likely be helpful to mark the last invocation
as the "final" invocation. This could be a -close
on a NSFilehandle
for
example:
invocation = [NSInvocation mulleInvocationWithTarget:foo
selector:@selector( printUTF8String:), s];
[queue addFinalInvocation:invocation];
With [queue start]
the queue is now executing in parallel with the calling
thread.
Requirement | Release Version | Description |
---|---|---|
MulleThread | ๐ MulleThread sleeps until nudged | |
MulleFoundationBase | ๐งฑ MulleFoundationBase amalgamates Foundations projects | |
mulle-objc-list | ๐ Lists mulle-objc runtime information contained in executables. |
Use mulle-sde to add MulleInvocationQueue to your project:
mulle-sde add github:MulleFoundation/MulleInvocationQueue
Use mulle-sde to build and install MulleInvocationQueue and all dependencies:
mulle-sde install --prefix /usr/local \
https://github.com/MulleFoundation/MulleInvocationQueue/archive/latest.tar.gz
Install the requirements:
Requirements | Description |
---|---|
MulleThread | ๐ MulleThread sleeps until nudged |
MulleFoundationBase | ๐งฑ MulleFoundationBase amalgamates Foundations projects |
mulle-objc-list | ๐ Lists mulle-objc runtime information contained in executables. |
Download the latest tar or zip archive and unpack it.
Install MulleInvocationQueue into /usr/local
with cmake:
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_PREFIX_PATH=/usr/local \
-DCMAKE_BUILD_TYPE=Release &&
cmake --build build --config Release &&
cmake --install build --config Release
Nat! for Mulle kybernetiK