Skip to content

Instantly share code, notes, and snippets.

@matzew
Created October 4, 2012 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save matzew/3832056 to your computer and use it in GitHub Desktop.
Save matzew/3832056 to your computer and use it in GitHub Desktop.
FAQ or Wiki or ...
  • What is a pipeline ?

A pipeline represents a set of n connections to a server. The pipeline class offers some simple 'management' APIs to work with containing 'pipe' objects. Basically it allows you to add or remove new connections to the pipeline.

  • What is a pipe ?

A pipe represents one connection to a server. The pipe API is basically an abstraction layer for any server side connection, which all allows you to simply 'read' from, or 'write' to a server connection. However, technical details like RESTful APIs (e.g. HTTP PUT or HTTT GET) are not exposed on the pipeline and pipe APIs. In the future you can have different type of pipe objects (-> connections). The default (and CURRENTLY only supported) type is a REST connection.

Below is an example from our JavaScript lib:

// create an empty pipeline:
var myPipeline = aerogear.pipeline();
// Add a connection/pipe object which is named 'myprojects' and points to a given server (RESTful) endpoint:
myPipeline.add({name: "myprojects", settings: {url: "https://todo-aerogear.rhcloud.com/todo-server/projects"}})

// Reading data from the 'myprojects' connection:
myPipeline.pipes['myprojects'].read();

In the above snippet the read will issue a HTTP GET request, but that fact is hidden to the user of the API. The user basically reads data from the server connection.

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