https://github.com/detro/srvzio
An helpful crate to implement services
https://github.com/detro/srvzio
Last synced: 11 months ago
JSON representation
An helpful crate to implement services
- Host: GitHub
- URL: https://github.com/detro/srvzio
- Owner: detro
- License: bsd-3-clause
- Created: 2019-04-04T21:36:03.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-14T17:55:05.000Z (about 4 years ago)
- Last Synced: 2024-12-01T09:12:02.882Z (over 1 year ago)
- Language: Rust
- Size: 15.6 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://crates.io/crates/srvzio)
[](https://travis-ci.org/detro/srvzio)
[](https://opensource.org/licenses/BSD-3-Clause)
[](https://docs.rs/crate/srvzio)
# srvzio - an helpful crate to implement services
## Services? What services?
This crate is inspired by my admiration and attachment to Google's [Guava](https://github.com/google/guava) library
for Java. Especially the [Services](https://github.com/google/guava/wiki/ServiceExplained).
A `Service` is then something that I would define as
_an entity that, when started it does work, and when stopped it does not_. Awfully vague, isn't it? OK, here is the
definition from the Guava wiki page on the topic:
The Service represents an object with an operational state, with methods to start and stop.
For example, webservers, RPC servers, and timers can [be] Services[s].
Managing the state of services like these, which require proper startup and shutdown management, can be nontrivial,
especially if multiple threads or scheduling is involved.
**srvzio** aims to provide a _rustic_ version of this. But, because of the enormous differences between Java and Rust,
we will start small, with few and simple abstractions, and then will hopefully grow the crate over time (maybe with
your contributions?).
## Building blocks
* `Service`: a Trait representing an object that can be started and can be stopped
* `ServiceStatusFlag`: a type designed to represent the internal state of a `Service` implementation
* `ServiceManager`: a [composite](https://en.wikipedia.org/wiki/Composite_pattern) of concrete `Service`s
## License
[BSD 3-Clause License](./LICENSE)