multiverses_pubsub v0.3.0 Multiverses.Phoenix.PubSub View Source

Implements the Multiverses pattern for Phoenix.PubSub.

Messages topics are sharded by postfixing the topic with a universe id. Processes in any given universe are then only capable of subscribing to messages sent within the same universe.

Usage

use Multiverses, with: Phoenix.PubSub

and in that module use the PubSub alias as if you had the alias Phoenix.PubSub directive.

To use with Phoenix.Presence, see: Using Multiverses with Phoenix Presence

Warning

This system should not be used in production to achieve sharding of communications channels.

Important

This does not shard across phoenix channels, as each channel will presumably already exist in the context of its own test shard and have requisite :"$callers" implemented by other functionality.

Link to this section Summary

Link to this section Functions

Link to this function

broadcast(pubsub, topic, message, dispatcher \\ Phoenix.PubSub)

View Source
Link to this function

broadcast!(pubsub, topic, message, dispatcher \\ Phoenix.PubSub)

View Source
Link to this function

broadcast_from(pubsub, from, topic, message, dispatcher \\ Phoenix.PubSub)

View Source
Link to this function

broadcast_from!(pubsub, from, topic, message, dispatcher \\ Phoenix.PubSub)

View Source

See Phoenix.PubSub.child_spec/1.

Link to this function

direct_broadcast(node_name, pubsub, topic, message, dispatcher \\ Phoenix.PubSub)

View Source
Link to this function

direct_broadcast!(node_name, pubsub, topic, message, dispatcher \\ Phoenix.PubSub)

View Source

See Phoenix.PubSub.dispatch/3.

Link to this function

local_broadcast(pubsub, topic, message, dispatcher \\ Phoenix.PubSub)

View Source
Link to this function

local_broadcast_from(pubsub, from, topic, message, dispatcher \\ Phoenix.PubSub)

View Source

See Phoenix.PubSub.node_name/1.

Link to this function

subscribe(pubsub, topic, opts \\ [])

View Source
Link to this function

unsubscribe(pubsub, topic)

View Source