Git Product home page Git Product logo

pyrpc's People

Contributors

justinfx avatar mattpaletta avatar sergiuszm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pyrpc's Issues

Import error on Python 3.6.8

Version import under package init causes issues with python 3:

Traceback (most recent call last):
File "my_file.py", line 5, in
from pyRpc import PyRpc
File "env/lib/python3.6/site-packages/pyRpc/init.py", line 48, in
from _version import version
ModuleNotFoundError: No module named '_version'

Changing init.py from:
from _version import __version__
To:
from ._version import __version__

Seems to resolve the issue.

RPC response takes ~25-35 seconds

Server:

def insa_dispatch_rpc():
	print(insa_c.magenta + "$insa> rpc triggered" + insa_c.white)
	return "heck"

def rpc_serve():

	globals.insa_rpc_server = PyRpc("insa_analytics", tcpaddr="127.0.0.1:4000") 

	globals.insa_rpc_server.publishService(insa_dispatch_rpc)

	globals.insa_rpc_server.start()

	print(insa_c.magenta + "$insa> rpc server is online" + insa_c.white)

	while True:
		time.sleep(.1)

def start_rpc_server():
	threading.Thread(target = rpc_serve, args = ()).start()

Client:

def retrieve_general_data(request):

	remote = RpcConnection("insa_analytics", tcpaddr="127.0.0.1:4000")

	_result = None
	_result = remote.call("insa_dispatch_rpc")

	remote.close()
	return HttpResponse(str(json.dumps(str(_result.result))))

retrieve_general_data is called instantly, I have tested this by returning an HttpResponse with a string. It is called instantaneously. For remote.call(...) to return, it takes around 25-35 seconds. Why is this? I tried raising workers to 32 threads.

Also, without specifying tcpaddr, it never connects to begin with. Yes, they are on the same host system.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.