davincif / simplestrpc Goto Github PK
View Code? Open in Web Editor NEWA simple RPC for python
License: Other
A simple RPC for python
License: Other
A better Aplication Protocol standard shall be defined for the middlewere.
A module shall be created to warp and unwarp, and message TCP messages, buffering them when needed.
Implement authorization, allowing the user to define whether a client shall be accepted or not.
Client
import sys
sys.path.append('../')
# for the user developer test
from simplestRPC.srpc_client import SRPCClient
client = SRPCClient()
ret = client.call_rpc('get_user_by_email', '[email protected]')
print(ret)
Server
import sys
sys.path.append('../')
from simplestRPC.srpc_server import SRPCServer
def get_user_by_email(email):
print('rodando -> get_user_by_email: ', email)
return str(2)
server = SRPCServer()
server.add_rpc(get_user_by_email)
server.serve()
it leads to this to a chash at the client, saying you passed no argumento to the rpc.
change this line
ret = client.call_rpc('get_user_by_email', '[email protected]')
for this
ret = client.call_rpc('get_user_by_email', '[email protected]', '[email protected]')
and it'll work.
The varenv.conf.json file is always required, even when it's not need. leading the user to add this file in his directory just so the simplesRPC can work.
By the time client and server are pairing the RPCs, there are, mathematically, a slight probability that two message get crushed into one, and the both, client and server, get deadlocked into a socket.receiv.
In the real world it does not seem to heappen. But it should be fixed anyway.
Currently the package does not supports connecting a client to a server by its hostname, only by its IP.
Please, add that feature.
Implement Cryptography for every msg sent by the middlewere
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.