Comments (6)
If this change is done, the best way to go about it will probably be to represent NewService
as a "service of services". In other words, to implement a NewService
, one would implement Service
such that Response: Service
.
To ease usage of this trait, the main "tower" crate can have a NewService
"trait alias".
Also, what do people think about renaming NewService
-> MakeService
and use the Make
prefix for "factories" instead of New
.
The main problem I have is, what does this return:
fn build_new_service() -> ....
Does it return T: Service
or T: NewService
?
fn build_make_service()
is a bit clearer.
Thoughts @seanmonstar @olix0r?
from tower.
The name NewServivce
does cause a little confusion. I'm fine with MakeService
, I think.
from tower.
To change NewService
to basically be a Service
of services, it seems making a new service would require mutable access (calling self.call
inside self.make_service
).
from tower.
There's also Service::poll_ready
, which suggests there needing to be a MakeService::poll_ready
. I actually think that makes sense, and allows for a server to say it cannot handle any more connections for now...
from tower.
@seanmonstar yes, I think poll_ready
makes sense, the question is about &mut self
. However, &mut self
makes sense with poll_ready
.
from tower.
We did this in #114.
from tower.
Related Issues (20)
- Adding option_layer causes trait bound unsastisfied HOT 1
- Publish release without pin-project (with pin-project-lite) HOT 5
- `tower::service_fn` docs don't say that you need the `util` flag HOT 3
- MQTT client adapter / framework HOT 1
- βFan outβ services? HOT 3
- Consider using `ControlFlow` for retry `Policy`.
- Extending `Building a middleware from scratch` guide
- breaking change in tower design (0.6 or beyond): first class support for async fn traits HOT 20
- unexpected behaviour of `RateLimit`
- experiment with permit based service framework HOT 5
- Tower & Warp server error
- Rate Limit Layer not Respected HOT 1
- Feature Request: implement `layer` method on `ServiceExt` HOT 2
- Port tower to futures-lite HOT 3
- Integrate GATs into tower-service HOT 1
- Add `BoxCloneSyncService` HOT 2
- Build fails with -Zbuild-std HOT 1
- Improve documentation for tower-test
- [Feature Request]: Middleware for client side which implements balancing the RPS
- How to set tower middleware dynamically
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tower.