Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage subscriber IDs and receivers for published messages in one place #18

Open
piroor opened this issue Jan 9, 2014 · 0 comments
Open

Comments

@piroor
Copy link
Contributor

piroor commented Jan 9, 2014

Actual (現状)

Currently, subscriber IDs and published messages are managed in two places, for SocketPublishSubscribe-commands and HTTPStreaming-commands.
So, published messages are delivered to correct subscribers by two similar codes in different layers. They should be unified to a "manager" class.

  • messages for SocketPublishSubscribe commands: delivered by codes in lib/adapter/socket.io.js (the framework)
  • messages for HTTPStreaming commands: lib/adapter/command.js (a specific command)

SocketPublishSubscribe型のコマンドとHTTPStreaming型のコマンドとで、subscriberとpublished messagesを別々に管理している。
published messageが届いた時に、対応するsubscriberに対してだけそのメッセージを配信する、という処理を、それぞれ別々のレイヤで管理している。

  • SocketPublishSubscribe型のコマンド → lib/adapter/socket.io.js のレイヤ(フレームワーク)
  • HTTPStreaming型のコマンド → lib/adapter/command.js のレイヤ(各コマンド固有の処理)

Expected (期待される状態)

  • They are managed by a single "manager" class.
  • We don't have to write delivering system for many times.
  • subscriberとpublished messagesの管理が一元化されている。
  • 対応するsubscriberに対してだけメッセージを配信する、という処理をその都度書かなくてもよいようになっている。

How to fix (解決方法)

Define a "manager" class and move modes to it.

SocketPublishSubscribe型のコマンド、HTTPStreaming型のコマンド、フレームワークの三者の関係を見直し、subscriberを一元管理するための新しい仕組みを作る。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant