/primus-emitter-objc

Simple emitter wrapper for primus-objc

Primary LanguageObjective-CMIT LicenseMIT

Primus-Emitter-Objc is an implementation of the Primus-Emitter plugin for the Primus realtime framework.

The library is fully unit tested using Specta, Expecta and OCMockito.

Build Status

Use it

pod 'PrimusEmitter'

Quick Start

#import <PrimusEmitter/PrimusEmitter.h>

- (void)start
{
	// By emitting an event on the server-side, the following listener will fire
	[primus on:@"custom:event:here", ^{
		NSLog(@"Received custom event");
	}];
	
	// The last parameter is a block that you can execute to acknowlege the event
	[primus on:@"another:example", ^(AckBlock ack) {
		NSLog(@"Received another event. Calling callback...");
		
		ack();
	}];
}

Credits

Many thanks to Jonathan Brumley, creator of the original primus-emitter plugin.