Skip to content

Built-in servers and clients for common transportsΒ #7

@baptiste0928

Description

@baptiste0928

Hello! While using Remoc in my application, I realized that some connection logic was duplicated:

  • I need to implement some basic connection logic each time I create a server/client type. This includes for example graceful shutdown or automatic reconnection.
  • I use Remoc to communicate between multiple services, where each service handles a single task. Therefore, all my Remoc servers send a channel or a rtc client as soon as the connection is created. Other channels may be created later, but the base channel is only used to send a more appropriate type.

I think these use cases are quite common, so I propose to include types to make their implementation easier:

  • Allow to initialize a connection with other types than base channel, for example directly with an RPC server/client or a broadcast channel. Maybe create Handler traits with methods that will be called directly after a connection is established.
  • Implement generic Client and Server types that are configured with a specific transport and handler, and manage the connection. This includes graceful shutdown and automatic reconnection, for example.
  • Abstract transports with a Transport trait, that could be used in Connect or directly with a Server/Client. Implementation for common transports such as TCP may be provided.

Built-in handlers for common usages such as RPC or broadcasting stream may be provided.

I think adding features like this would make remoc much easier to use by hiding some things that may seem complex to beginners, without sacrificing the flexibility of the library, since all these features would be optional, and could even be used partially. Remoc is a project that can be useful to many people and fulfills many use cases. Making it easier to get started with would in my opinion make it much more used and would make it a serious alternative to tarpc or tonic.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions