eventifyio / eventify

Lightweight Module for Asynchronous Event Driven Systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eventify 0.4.6 - error in `eventify.drivers.crossbar.Component.onConnect`

danie1k opened this issue · comments

Method

eventify.drivers.crossbar.Component.onConnect

should call

eventify.drivers.base.BaseComponent.onConnect

but instead it calls

autobahn.wamp.protocol.ApplicationSession.onConnect

on line 40:

    async def onConnect(self):
        """
        Inherited from BaseComponent
        """
        super(BaseComponent, self).onConnect()  # <-- Here
        self.log.info("connected")
        self.join(self.config.realm)

Which causes an exception from method

eventify.drivers.crossbar.Component.onJoin

because self.handlers property doesn't exists in line 149
(it is set ineventify.drivers.base.BaseComponent.onConnect):

    async def onJoin(self, details):
        self.log.debug("joined websocket realm: %s", details)

        # set session_id for reconnect
        self.session_id = details.session
        self.realm_id = details.realm

        for handler in self.handlers:  # <-- Here
            # initialize handler
            handler_instance = handler()
            handler_instance.set_session(self)
            ...

Python 3.6.2, linux (Debian family).

(venv) [mharris@mori eventify]$ git status
On branch master
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified:   docs/conf.py
modified:   eventify/drivers/base.py
modified:   eventify/drivers/crossbar.py
modified:   example/crossbar/send_test_event_rest.sh
modified:   example/crossbar/service/handler.py
modified:   setup.py

Untracked files:
(use "git add ..." to include in what will be committed)

dist/eventify-0.4.7.tar.gz
example/crossbar/ex_pub.py

no changes added to commit (use "git add" and/or "git commit -a")
(venv) [mharris@mori eventify]$ git add .
(venv) [mharris@mori eventify]$ git commit
[master eaeaae7] Resolve #147 Update example for crossbar Tested both kafka and crossbar on 0.4.7 Upgrade from 0.4.6 -> 0.4.7
8 files changed, 50 insertions(+), 15 deletions(-)
create mode 100644 dist/eventify-0.4.7.tar.gz
create mode 100644 example/crossbar/ex_pub.py
(venv) [mharris@mori eventify]$ git push origin master
Counting objects: 17, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (17/17), done.
Writing objects: 100% (17/17), 12.03 KiB | 12.03 MiB/s, done.
Total 17 (delta 11), reused 0 (delta 0)
remote: Resolving deltas: 100% (11/11), completed with 11 local objects.
remote: This repository moved. Please use the new location:
remote: git@github.com:eventifyio/eventify.git
To github.com:morissette/eventify.git
39b74e3..eaeaae7 master -> master