Objective-C in the Cloud

OCCInvocationGroup Class Reference

Declared inOCClient/OCInvocationGroup.h
Base classNSObject
GuidesClient Libraries (Tutorial)
Client Libraries Conceptual Guide

Overview

An invocation group executes the code including messages to the cloud service in a block asynchronously. You can put synchronous messages into the block to send them synchronously.

If messages are sent inside an invocation group synchronously they do not return an instance of NSError on an error, but nil and set the error property of the invocation context. This lets you use the messages to nil behavior of Objective-C. Additionally consecutive messages inside the invocation group are not dispatched anymore and always return nil, if they have a type different to void.

There is a single class method +executeBlock: that starts the execution of an block containing the invocation group. The block gets a invocation context as its single argument:

[OCCInvocationGroup executeBlock:
^(OCCInvocationContext *context)
{

}];

By now there is a single class method +executeBlock: that executes the block.

Tasks

Execution

+executeBlock

Class Methods

+executeBlock:

Executes the block.

+(void)executeBlock:(OCCInvocationGroupBlock)block;

Parameters

block
The block to be executed.

Discussion

This method creates an instance object of OCCInvocationContext and runs the block asynchrounously passing the newly created instance as the single argument.

An internal queue is used.

Types

OCCInvocationGroupBlock

Block that contains the code of an invocation group.

typedef void (^OCCInvocationGroupBlock)( OCCInvocationContext *context );