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

Replace Comms MessageBroker with Pub/Sub #644

Closed
sdbondi opened this issue Aug 5, 2019 · 0 comments · Fixed by #671
Closed

Replace Comms MessageBroker with Pub/Sub #644

sdbondi opened this issue Aug 5, 2019 · 0 comments · Fixed by #671
Assignees
Labels
C-enhancement Category - New feature or request
Milestone

Comments

@sdbondi
Copy link
Member

sdbondi commented Aug 5, 2019

Replace the MessageBroker with Pub/Sub architecture. All messages coming in from the comms layer will be published under the TariMessageType topic. A Subscriber will be available for all services. This can be used to create a subscription to any number of message types they're interested in.

@sdbondi sdbondi added the C-enhancement Category - New feature or request label Aug 5, 2019
@sdbondi sdbondi modified the milestones: Testnet 1, TestNet Release Aug 6, 2019
@philipr-za philipr-za self-assigned this Aug 6, 2019
CjS77 added a commit that referenced this issue Aug 15, 2019
This PR contains the building blocks for async p2p services.

It consists of the following modules:

* builder: contains the MakeServicePair trait which should
  be implemented by a service builder and the
  StackBuilder struct which is responsible for building the
  service and making service handles available to all the other services.
  Handles are any object which is able to control a service in some way.
  Most commonly the handle will be a transport::Requester<MyServiceRequest>.

* handles: struct for collecting named handles for services.
  The StackBuilder uses this to make all handles available to services.

* transport: This allows messages to be reliably send/received to/from
  services. A Requester/Responder pair is created using the transport::channel
function which takes an impl of tower_service::Service as it's first parameter.
A Requester implements tower_service::Service and is used to send requests
which return a Future which resolves to a response. The Requester uses a
oneshot channel allow responses to be sent back. A Responder receives a
(request, oneshot::Sender) tuple, calls the given tower service with that
request and sends the result on the oneshot::Sender. The Responder handles many
requests simultaneously.

Notes:

This PR adds the rust feature #![feature(existential_type)] to reduce the need
to box futures in many cases - more info here: rust-lang/rfcs#2071

TODO:

Hook up pub/sub messages from the comms layer. (Ref #644)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants