Comments (2)
Is this something that we should let the user implement? It's really pretty easy but the user would end up making the same kind of loop to manage it, ie:
# server.nim
proc send_chat(name: string, msg: string) {.networked.} =
## Dispatch chat messages to all connected clients regardless of who sent it.
for c in nettyrpc.reactor.connections:
if c != conn:
rpc(c, "display_chat", (name: name, msg: msg, originId: conn.id))
I suppose that in the context of game development, we would want the rpc to go to the connection that called it though. Should we have a way to exclude the origin of an RPC from getting the response for situations where it doesn't need one?
Feel free to close this if you think it's not an issue. The user can definitely implement something like this if they need to but might be worth considering. The more I think about it the more I feel like it's probably a non-issue
from nettyrpc.
We could add a message flag, which can be used to send more information, such as noResponse
so the packet would look like
MessageKind, MessageFlag, data
. then calling it would look like r rpc({noResponse}, "send_chat", (name: name, msg: msg))
or a short hand of rpcNoResponse("send_Chat", (name: name, msg: msg))
from nettyrpc.
Related Issues (2)
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 nettyrpc.