Comments (11)
Hi, thanks for raising this issue! In the example service, it does spawn the serve futures. Any idea what's different in yours? I suspect the issue is that your code is trying to be generic over multiple services?
from tarpc.
Yes, it is because I'm trying to make a generic function. Although in all generated trait implementations, the future returned by serve()
are Send
, the signature of serve()
itself does not require that. So merely by looking at Serve
, the compiler cannot decide whether or not the future is Send.
from tarpc.
How large of a library are you writing that is generic over tarpc service functions? And how many tarpc services do you expect to use the library? I'm trying to gauge whether it'd be practical to just write the code once per service.
from tarpc.
Writing code for each service indeed would work for me. I only have two concrete service type to support.
Feel free to close as "working as intended".
from tarpc.
Thanks for the details! I'll keep this issue open, because I would like to fix it eventually, potentially just waiting for Rust to offer a more complete solution.
from tarpc.
@tikue what do you think about adding in trait-variant? It fixes this use case (I tested it in my fork), and is officially suggested by the Rust lang team.
Only hiccup is that usage of that macro would conflict with this blanket impl, which I'm not sure of a solution too without specialization or negative bounds.
I'm happy to work through a PR π
from tarpc.
Related Issues (20)
- Multi-client requests HOT 2
- Bidirectional RPC HOT 3
- Cross Platform Procedure Call HOT 2
- [FEATURE REQUEST] Stream responses HOT 4
- QUESTION: how to get tcp server features for custom transport? HOT 1
- Consider making tracing optional HOT 8
- Bubble up server side transport errors to the client HOT 5
- Design problem, how to call other structs method ?
- Server-side span with clientβs span as parent HOT 3
- Recommended way for connection pooling? HOT 4
- Support for Async Fn in Trait? HOT 3
- Generic type parameters HOT 4
- On client's read errors quick subsequent requests may wait for response indefinitely HOT 9
- Adding client ID to identify clients (and retrieve specific context)? HOT 2
- Associated data with client
- Add a way to derive Clone for the generated Request and Response types HOT 5
- Rkyv support?
- Json support and automatic documentation generation HOT 2
- Feature: cli support for translating defined placeholder to generate proto from codebase directly
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 tarpc.