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

Remove "server" feature(s) #146

Open
uklotzde opened this issue Feb 5, 2023 · 7 comments
Open

Remove "server" feature(s) #146

uklotzde opened this issue Feb 5, 2023 · 7 comments
Milestone

Comments

@uklotzde
Copy link
Member

uklotzde commented Feb 5, 2023

The server features should be split off into a separate crate before releasing version 1.0. This might require to extract shared code into a separate crate.

@uklotzde uklotzde added this to the v1.0 milestone Feb 5, 2023
@uklotzde uklotzde changed the title Remove server feature(s) Remove "server" feature(s) Feb 5, 2023
@cdbennett
Copy link
Contributor

I am actively investigating using this library in projects as both a client and a server.

I agree that extracting the TCP server stuff into a separate crate would be cleaner. I would be interested in perhaps writing some examples/documentation or other ways of contributing to help the project.

@flosse
Copy link
Member

flosse commented Feb 26, 2023

This might require to extract shared code into a separate crate.

how about tokio-modbus-server?

@flosse
Copy link
Member

flosse commented Feb 26, 2023

... or probably we even create a new "namespace" and split it like this:

  • core: nostd compatible like modbus-core
  • tokio: general foundation for tokio based usage
  • client: convenient implementations & utilities for clients
  • server: convenient implementations & utilities for servers

@cdbennett
Copy link
Contributor

When trying to implement a server library, it seems it would be useful to describe some concrete use cases for the server.

This would direct the design of the API and consequently the implementation of the server as well.

Kind of like in test-driven development, or having a real user as a customer, some simple example applications would both help direct the development of an API, and also would give library users an example of how to use the library.

Some things I'm thinking about:

  • What kind of applications are people going to use the Modbus server library for?
  • How will users handle concurrent requests from multiple clients?

@lindblandro
Copy link

Are you discussing splitting the current crate into multiple smaller ones in the existing repository or create multiple smaller repos, one for each crate?

@Halkcyon
Copy link
Contributor

I find the server feature helpful for integration testing, personally, which is how I put it to use.

@cdbennett
Copy link
Contributor

I find the server feature helpful for integration testing, personally, which is how I put it to use.

Agreed, it is useful in many contexts. I think the change is to create a new tokio-modbus-server crate, which uses the core tokio-modbus crate but adds the server-specific stuff.

It makes more sense than shoving into a single crate with a feature flag... the server itself might evolve at a different pace from the core Modbus functionality that a client would need, so decoupling them makes sense.

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

5 participants