Git Product home page Git Product logo

occamy's People

Contributors

jhosteny avatar sotte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

sotte nerandell

occamy's Issues

Timeout of threads of callbacks cause errors

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.

No automatic reconnect

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.

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.