Pixie

This module defines sensible defaults for all user configurable options, and provides a few helper functions, such as publish and subscribe.

Source

Summary

backend_options()

Returns either the configured backend options, or [name: :ETS]

bayeux_version()

Returns the Bayeux version which Pixie implements. Currently "1.0"

configured_extensions()

Returns a list of the configured extensions

enabled_transports()

Returns a list of the currently enabled transports. This can be configured with:

publish(message)

Publish an arbitrary map. This converts the map to a Pixie.Message.Publish struct

publish(channel, data)

Publish a message to the specified channel. This saves you from having to build the Pixie.Message.Publish yourself, you can simply specify the channel to publish to and an arbitrary map for the message's data property

start()
start(, )

Used to start the Pixie application by Mix

subscribe_immediately?()

The Bayeux protocol is undecided as to whether subscription requests should be responded to immediately, or can wait until either the next connect timeout, or the next message arrives for delivery to the client

timeout()

Returns configured timeout in milliseconds. Defaults to 25000 if nothing is configured

version()

Returns the currently running Pixie version

Functions

backend_options()

Returns either the configured backend options, or [name: :ETS].

Source
bayeux_version()

Returns the Bayeux version which Pixie implements. Currently "1.0"

Source
configured_extensions()

Returns a list of the configured extensions.

Source
enabled_transports()

Returns a list of the currently enabled transports. This can be configured with:

config :pixie, :enabled_transports, ~w| long-polling websocket |

Defaults to ["long-polling", "cross-origin-long-polling", "callback-polling", "websocket"].

Source
publish(message)

Publish an arbitrary map. This converts the map to a Pixie.Message.Publish struct.

Source
publish(channel, data)

Publish a message to the specified channel. This saves you from having to build the Pixie.Message.Publish yourself, you can simply specify the channel to publish to and an arbitrary map for the message's data property.

Source
start()
Source
start(, )

Used to start the Pixie application by Mix.

Source
subscribe_immediately?()

The Bayeux protocol is undecided as to whether subscription requests should be responded to immediately, or can wait until either the next connect timeout, or the next message arrives for delivery to the client.

By default Pixie waits to send subscribe requests, however if you have client's expecting an immediate response to subscriptions you can turn this on.

An example of why you may want to send subscription responses immediately:

client = new Faye.Client("http://my.chat.server/pixie");
client.subscribe("/foyer").then(function() {
  client.publish("/foyer", {message: "New user joined channel #foyer"})
}, function(err) {
  alert("Unable to join #foyer: " + err)
});

See Faye's documentation for more information.

Source
timeout()

Returns configured timeout in milliseconds. Defaults to 25000 if nothing is configured.

This value is used by Pixie to decide how long to wait between connect responses, and various multiples are used for client expiry timeouts, etc.

Source
version()

Returns the currently running Pixie version.

Source