jhosteny / occamy Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
The error callback when joining a channel that one has no access to, i.e., :error
is returned by phoenix, throws an error:
channel = socket.channel("project:no_access")
channel.join()\
.receive("error", lambda _: sys.exit())
This is the error:
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 1184, in run
self.finished.wait(self.interval)
File "/usr/lib/python3.4/threading.py", line 553, in wait
signaled = self._cond.wait(timeout)
File "/usr/lib/python3.4/threading.py", line 293, in wait
if timeout > 0:
TypeError: unorderable types: function() > int()
Whereas joining a channel successfully works:
channel.join()\
.receive("ok", lambda: print("Successfully joined"))
I haven't had time to debug it. I'll just write it down and add more information later.
When killing and restarting the server occamy does not reconnect. The error looks something like this:
Exception in thread WebSocketClient:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/home/stefan/datei/datei_server_experiment/occamy/.venv/lib/python3.4/site-packages/ws4py/websocket.py", line 509, in run
self.terminate()
File "/home/stefan/datei/datei_server_experiment/occamy/.venv/lib/python3.4/site-packages/ws4py/websocket.py", line 410, in terminate
self.closed(1006, "Going away")
File "/home/stefan/datei/datei_server_experiment/occamy/occamy/socket.py", line 55, in closed
observer.closed(code, reason)
File "/home/stefan/datei/datei_server_experiment/occamy/occamy/socket.py", line 113, in closed
channel.trigger(Channel.EVENTS['error'])
File "/home/stefan/datei/datei_server_experiment/occamy/occamy/channel.py", line 157, in trigger
binding['callback'](payload, ref)
File "/home/stefan/datei/datei_server_experiment/occamy/occamy/channel.py", line 53, in <lambda>
self.on(Channel.EVENTS['error'], lambda payload, _: cb(payload))
File "/home/stefan/datei/datei_server_experiment/occamy/occamy/channel.py", line 132, in _errored
self._rejoin_timer.start()
File "/usr/lib/python3.4/threading.py", line 846, in start
raise RuntimeError("threads can only be started once")
RuntimeError: threads can only be started once
Exception in thread Thread-35:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 1186, in run
self.function(*self.args, **self.kwargs)
File "/home/stefan/datei/datei_server_experiment/occamy/occamy/repeated_timer.py", line 19, in _run
self._function(*self._args, **self._kwargs)
File "/home/stefan/datei/datei_server_experiment/occamy/occamy/socket.py", line 208, in _reconnect
self._websocket_impl.connect()
File "/home/stefan/datei/datei_server_experiment/occamy/.venv/lib/python3.4/site-packages/ws4py/client/__init__.py", line 210, in connect
self.sock.connect(self.bind_addr)
ConnectionRefusedError: [Errno 111] Connection refused
I'll do some research and check in more information later.
I'm trying to get occamy to work but the channels get stuck in the "joining" state.
Here is a minimal phoenix channel implementation which implements this: http://www.phoenixframework.org/docs/channels#section-tying-it-all-together. Just start the server mix phoenix.server
.
Here is the python client I'm using. python demo.py
runs the client and you can see that the channel state is always "joining".
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.