Skip to content

Commit

Permalink
docs: update architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Jul 21, 2022
1 parent 76e1f34 commit 779247c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ _Channel_ is a business-logic abstraction (similar to Action Cable Channel). It

## Hub

_Hub_ is a part of Cable, which keeps track of Channels. Incoming data go to Hub, which transmits it further to a designated Channel. One interesting feature of Hub is that it helps to deal with race conditions during channels subscriptions by keeping pending messages while confirmation is in progress (see [code][hub-pending]).
_Hub_ is a part of Cable, which keeps track of _Subscriptions_. Subscription represents a server-side channel instance and MAY have multiple client-side Channel instances attached.Incoming data go to Hub, which transmits it further to a designated Subscription, which in its turn notify channels. One interesting feature of Hub is that it helps to deal with race conditions when subscribing to and unsubscribing from channels.

## Monitor

_Monitor_ is responsible for keeping Cable connected. First, it tracks Ping messages and triggers reconnection if they're missing. Secondly, it tries to reconnect when an unexpected disconnect occurs (using a configurable backoff strategy).

[hub-pending]: https://github.com/anycable/anycable-client/blob/ecc5f73e299d361d331628255746cabc1841f50e/packages/core/hub/index.js#L50-L59
[create-cable]: https://github.com/anycable/anycable-client/blob/master/packages/core/create-cable/index.js
Binary file modified docs/assets/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 779247c

Please sign in to comment.