Skip to content

Instantly share code, notes, and snippets.

@matzew
Created October 15, 2012 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzew/3892384 to your computer and use it in GitHub Desktop.
Save matzew/3892384 to your computer and use it in GitHub Desktop.
Options for AGPipe creation

Using 'options' for pipe creation

// empty pipeline:
AGPipeline* myPipeline = [[AGPipeline alloc] init];

// create a new pipe, by applying some PIPE OPTIONS:
id<AGPipe> myPipe =
    [myPipeline newPipe:PIPE_NAME, @"my pipe", PIPE_TYPE, @"REST",
        PIPE_BASE_URL, [NSURL URLWithString:@"http://api.server.com/context/"],
    nil]; // termination of options with nil 

The AGPipeline API would look like:

@interface AGPipeline : NSObject

/**
 * Returns the AGPipe, which is created using AGPipeOptions
 * 
 * @return the new AGPipe object
 */
-(id<AGPipe>) newPipe:(AGPipeOption*) firstOption, ...;

/**
 * Removes a pipe from the AGPipeline object
 *
 * @param name the name of the actual pipe
 *
 * @return the new created AGPipe object
 */
-(id<AGPipe>) remove:(NSString*) name;

/**
 * Look up for a pipe object.
 *
 * @param name the name of the actual pipe
 *
 * @return the new created AGPipe object
 */
-(id<AGPipe>) get:(NSString*) name;

@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment