FixAlchemy.Dispatch (FIXAlchemy v0.2.4)
View SourceKeyed pub/sub subscription state for one session.
Subscribers (processes) register interest in a message type as one of:
- all — every message of that type (
subscribe(d, pid, "8")) - exact — messages where a tag equals a value
(
subscribe(d, pid, "W", "EUR/USD")) - predicate — messages where a tag satisfies a function
(
subscribe(d, pid, "8", tag: 271, where: &(String.to_integer(&1) > 10_000)))
Pure state: every function returns a new struct, and delivery is the caller's job.
Routing tag resolution
For a keyed or predicate subscription the routing tag resolves, most specific
first: the subscription's :tag option, then the connection's routing_keys
override for that message type, then the shipped default for that type, then
the fallback (Symbol, tag 55).
Summary
Functions
The protocol-level default routing tags, overridable per connection.
Build dispatch state; overrides merge over the shipped defaults.
Pids to deliver a message of type to, given values (%{tag => wire_value}
extracted for the subscribed tags).
Remove pid from every subscription (e.g. on its :DOWN).
Subscribe pid to type.
Whether any subscriber wants this message type.
The distinct routing tags subscribed for a type (the tags to scan).
Types
Functions
The protocol-level default routing tags, overridable per connection.
Build dispatch state; overrides merge over the shipped defaults.
Pids to deliver a message of type to, given values (%{tag => wire_value}
extracted for the subscribed tags).
Remove pid from every subscription (e.g. on its :DOWN).
Subscribe pid to type.
subscribe(d, pid, type)— all messages of that typesubscribe(d, pid, type, value)— where the routing tag equalsvaluesubscribe(d, pid, type, :all, tag: t, where: fun)— wherefun.(tag_value)
Whether any subscriber wants this message type.
The distinct routing tags subscribed for a type (the tags to scan).