racketmq-2017/racketmq/hub
Tony Garnock-Jones 2a9273142a Split out relay subscriptions from remote topics.
The previous code was trying to do too much with local dataflow. This
refactoring splits (stateful) relay upstream subscriptions out into
actors of their own.

Previously, dataflow variables were used to hold a single upstream hub
and a single upstream canonical topic URL. This causes problems when
things change rapidly: an unsubscription or subscription might be in
flight, and there was no way to tell what the resulting state of the
remote topic as a whole should be if the fields had changed between
the start and finish of an in flight action.

The new design follows from the observation that an individual
subscription to an upstream hub is a stateful entity: it deserves
promotion to a full actor. There is now an actor for the remote topic,
and one for each established upstream subscription. Upstream
subscriptions are created in response to demand expressed by the
remote topic actor; to switch, all it needs to do is update its
demand, and new subscriptions will spring into being while surplus
subscriptions gracefully terminate.

Also, this commit fixes a bug where upstream subscriptions were being
made to the requested-topic rather than to the upstream-topic.
Consequently, self-subscriptions (with multiple `http-listener`
aliases) work now without infinite mail loops.

There is still an issue that blocking actions in on-stop clauses don't
run to completion; that is being dealt with separately, as part of a
reexamination of facet-terminating events more generally.
2016-11-22 15:16:35 +13:00
..
local-topic.rkt Remove layer of actor*, to avoid out-of-context field access; switch from 201 to 202 for posts 2016-11-22 13:32:32 +13:00
remote-topic.rkt Split out relay subscriptions from remote topics. 2016-11-22 15:16:35 +13:00
static-content.rkt Reinterpret canonical-local-host -> canonical-baseurl. 2016-11-22 11:35:39 +13:00
subscription.rkt Reinterpret canonical-local-host -> canonical-baseurl. 2016-11-22 11:35:39 +13:00
topic-demand.rkt Reinterpret canonical-local-host -> canonical-baseurl. 2016-11-22 11:35:39 +13:00
websocket.rkt Reinterpret canonical-local-host -> canonical-baseurl. 2016-11-22 11:35:39 +13:00