ceelian / callme Goto Github PK
View Code? Open in Web Editor NEWcallme is a python amqp rpc module
License: BSD 3-Clause "New" or "Revised" License
callme is a python amqp rpc module
License: BSD 3-Clause "New" or "Revised" License
Hello,
kombu
should be add as an explicit dependency of callme.
On Windows 7
> pip install callme
raises ImportError: no module named kombu
Kind regards
If I try to do a
$ pip install callme
in a fresh virtualenv (with no kombu
installed), pip
cannot do its job:
Downloading/unpacking callme (from -r requirements.txt (line 5))
Running setup.py egg_info for package callme
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/home/systems/syv/.virtualenvs/webdev/build/callme/setup.py", line 13, in <module>
import callme
File "src/callme/__init__.py", line 10, in <module>
from server import Server
File "src/callme/server.py", line 8, in <module>
from kombu import BrokerConnection, Exchange, Queue, Consumer, Producer
ImportError: No module named kombu
Although the dependency on kombu
is explicit in setup.py
, that file (setup.py
) also has the following statement:
import callme
(on line 13 as of callme 0.1.0) which fails if kombu
is not already present.
I suggest moving the symbols __version__
, __author__
and similar from module callme
to something like callme.info
, for instance, and then doing:
from callme import info
from setup.py
.
Hello,
Kombu seems to disallow pickled objects.
I think they did it for security reason (should we care?)
How can I enable it ?
Is there a way to urge callme to use JSON RPC instead ?
Kind regards
Add "ServerNotFoundError" Exception when you try an RPC call where no Exchange is defined on the broker.
After adding the 'accept' parameter to the consumer - code stopped to work on Kombu<3.0.0 with
(TypeError: init() got an unexpected keyword argument 'accept').
Shell you revert this, since we already added 'kombu>=1.2.1,<3.0.0' in the install_requires?
Pickle allows for arbiatary messages to be sent that can cause unintend remoted execute, this may not be much to worry about, but it does break a hole in that the RPC server can now execute pretty much anything that its containing program has the permissions to execute. It looks like the default kombu serializer used is pickle :-/
Why rpc server demo failed with callme.exceptions.ConnectionError: Broker connection failed
?, how to fix it?
When used in some circumstance the proxy object does not clean itself up in a sensible manor, for example if you create a proxy global object in Flask or Django, use it for the duration of the request and then kill it during request tear down the response queue remains indefinitely until the application is recycled.
Proposed fix: Add a destructor to the proxy class to clean up proxy objects in a suitable fashion.
Instead of creating unbounded numbers of threads it would be great to use a futures executor https://docs.python.org/dev/library/concurrent.futures.html and a pool size instead, this ensures that the rpc program will not be overloaded.
When I do a fresh clone of the repo and running tox and the run_tests.sh no integration test gets executed.
Charly:callme christian$ ./run_tests.sh -i
integration create: /Users/christian/tmp/callme/.tox/integration
integration installdeps: -r/Users/christian/tmp/callme/requirements.txt, -r/Users/christian/tmp/callme/test-requirements.txt
integration runtests: PYTHONHASHSEED='2433771540'
integration runtests: commands[0] | nosetests --verbosity=2 src/callme/tests/integration
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
________________________________________________________________ summary _________________________________________________________________
integration: commands succeeded
congratulations :)
Hello,
I think you should use a Fibonnacci function as RPC example
def fib(n):
"""Fibonacci function"""
if n == 0:
return 0
elif n == 1:
return 1
else:
return fib(n-1) + fib(n-2)
Such an example could should how to use timeout (either on client side or on server side) because calculating fib(5) is quite short but fib(20) or fib(25) is much longer.
Kind regards
It would be nice if I were able to use keyword arguments in calls from the proxy to the server. Currently calls only support positional arguments.
It looks like it would be fairly straightforward to add a func_keywords attribute to the RpcRequest object in protocol.py, capture them when Proxy creates the request object (I can't seem to find relevant section of code), and unpack them together with positional arguments in line 143 of server.py as so:
result = self._func_dict[request.func_name](*request.func_args, **request.func_kw_args)
It's crunch time for me at work, so I don't have a lot of time to spend on this at the moment. If nobody has time to work on this, I can take a look again in a month or so and send a pull request with the feature in place.
Christian,
How about adding BSD license header to each project file with code? I saw this is quite common for other projects.
Add asynchronous support see http://groups.google.com/group/qam-users/browse_thread/thread/e1bad823001e6d9c
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.