My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

This tiny Objective-C library allows you to send and receive asynchronous messages between processes or threads akin to the Erlang concurrency approach.

Plankton is thus an actor oriented peer-to-peer platform for asynchronous share-nothing message passing.

Messages can be any Objective-C objects which represent property-lists. Plankton uses the Cocoa property-list encoding for the on-the-wire representation. Message reception is done via the NSPredicate facility of Coca which allows for sophisticated pattern specifications.

Usage of Plankton should be easy:

  1. create a PLPlatform object and cling to it
  2. PLPlatform *platform = [[PLPlatform alloc] init];
  3. create your own actor-id
  4. NSString *aid = [platform createAid];
  5. send a message to another actor (you need its aid for that)
  6. [platform send:message to:otherAid];
  7. prepare reception of messages from other actors
  8. PLPattern *pattern = [[PLPattern patternWithPredicateFormat:@"SELF in {'quit', 'exit'}"] retain];
    [pattern setMessageTarget:self action:@selector(onQuit:)];
    [platform receive:pattern by:aid];
  9. receive messages
  10. - (void)onQuit:(id)messsage pattern:(PLPattern *)pattern
    {...}

Check out the PLDirectory class on how to use the above API. PLDirectory is a simple directory service actor which communicates with peer directories to look up directory entries.

The code is work in progress. Please check out the Source instead of using any of the outdated zip downloads.

Powered by Google Project Hosting