pipeline v0.1.0 Pipeline.Adapter.Cowboy

Pretty much built off Plug’s adapter, but simpler and supports the static optimization mechanisms provided by pipeline.

Invoking use Pipeline.Adapter.Cowboy will create a pipeline/1 function that accepts cowboy connects to be run through the pipeline specified by the pipeline parameter. This module should be used in your server process and needs little more than that to be setup.

Your server, could for example, look like:

defmodule Server do
  use Pipeline.Adapter.Cowboy, pipeline: Entry.pipeline
end

Your supervisor should add your server as a worker:

children = [
  # Start pipeline-based server.
  worker(Server, [[port: 4000]]),
]

You can configure your cowboy application with a number of other attributes.

 * acceptors
 * protocol
 * port

Note that you do NOT need to use Plug connection objects to use this adapter,
though using any plug-based pipeline's will require it.

TODO: Add more options to be at feature-parity with Plug’s adapter.

Summary

Functions

Make sure cowboy is running

Functions

ensure_cowboy()

Make sure cowboy is running.