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

create interface-service-discovery based on rendezvous proposal #47

Open
dryajov opened this issue Apr 12, 2018 · 1 comment
Open

create interface-service-discovery based on rendezvous proposal #47

dryajov opened this issue Apr 12, 2018 · 1 comment

Comments

@dryajov
Copy link
Member

dryajov commented Apr 12, 2018

creating this issue here first for lack of a better place

Now that we have #44, I think we should start thinking about an additional interface for service discovery. The rational being, in the past rendezvous services (servers), provided a peer discovery mechanism, the proposal in #44 satisfies this requirements and can be adapted to be used as a pure peer discovery mechanism that implements interface-peer-discovery. However, we're lacking an interface to describe the new operations that rendezvous brings about, namely registering and discovering peers under a specific namespace. Defining an interface allows us to implement this functionality using alternative mechanisms, such as DHT.

A rendezvous service can satisfy this two use cases - pure peer discovery defined under interface-peer-discovery and service discovery interface-service-discovery.

Here is a very rough first draft (pseudo flow):

// interface-service-discovery

interface DiscoveryResponce {
  timestamp: int64;
  peers: PeerInfo[];
}

interface ServiceDiscovery {
  register(namespace: string, peer: PeerInfo): bool;
  discover(namespace?: string, limit?: int, since?: timestamp): DiscoveryResponce;
} 

I'm still not %100 sold on the naming, so take it with a grain of salt atm. The gist of the operations I want to convey with this interface can be summarized with:

  • A peer wants to be able to register and be discoverable under a certain namespace
  • A peer wants to discover other peers registered under a certain namespace

EDIT:

  • marked discover params as optional (? means optional)
  • added the word peer to in the past rendezvous services (servers), provided a...
  • added DiscoveryResponce type to allow returning a timestamp along side the peer
  • corrected DiscoveryResponce to return a list of peers and a timestamp
@vyzo
Copy link
Contributor

vyzo commented Apr 12, 2018

discover should return two values, a PeerInfo list and a timestamp to thread in subsequent discover invocations.

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

No branches or pull requests

2 participants