|
Project Information
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:
PLPlatform *platform = [[PLPlatform alloc] init]; NSString *aid = [platform createAid]; [platform send:message to:otherAid]; PLPattern *pattern = [[PLPattern patternWithPredicateFormat:@"SELF in {'quit', 'exit'}"] retain];
[pattern setMessageTarget:self action:@selector(onQuit:)];
[platform receive:pattern by:aid];- (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. |