Skip to content

๐Ÿšถ๐Ÿšถ๐Ÿšถ MulleInvocationQueue runs code in a separate thread

License

Notifications You must be signed in to change notification settings

MulleFoundation/MulleInvocationQueue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

32 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MulleInvocationQueue

๐Ÿšถ๐Ÿšถ๐Ÿšถ MulleInvocationQueue runs methods in a separate thread

A MulleInvocationQueue is fed with NSInvocations, which it then executes in serial fashion in a separate thread.

Release Version Release Notes
Mulle kybernetiK tag Build Status RELEASENOTES

MulleInvocationQueue

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.

Requirements

Requirement Release Version Description
MulleThread Mulle kybernetiK tag Build Status ๐Ÿ MulleThread sleeps until nudged
MulleFoundationBase Mulle kybernetiK tag Build Status ๐Ÿงฑ MulleFoundationBase amalgamates Foundations projects
mulle-objc-list Mulle kybernetiK tag Build Status ๐Ÿ“’ Lists mulle-objc runtime information contained in executables.

You are here

Overview

Add

Use mulle-sde to add MulleInvocationQueue to your project:

mulle-sde add github:MulleFoundation/MulleInvocationQueue

Install

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

Legacy Installation

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

Author

Nat! for Mulle kybernetiK

About

๐Ÿšถ๐Ÿšถ๐Ÿšถ MulleInvocationQueue runs code in a separate thread

Resources

License

Stars

Watchers

Forks

Packages

No packages published