Publish from an event handler (Python)

#1

Hi,

Is it possible to publish an event from within an event handler?

Example:
def doit():
…do some work…

…notify that work is done by publishing another event…
(I tried appSession.publish(WORKDONE)…but it does not seem to work)

yield self.subscribe(doit, DOIT)

Thanks,
Raffaele

0 Likes

#2

Hi Raffaele,

> Is it possible to publish an event from within an event handler?

Sure. Just do session.publish() where session is an instance of ApplicationSession

Cheers,
/Tobias

···

Example:
def doit():
....do some work...

...notify that work is done by publishing another event...
(I tried appSession.publish(WORKDONE)...but it does not seem to work)

yield self.subscribe(doit, DOIT)

Thanks,
Raffaele

--
You received this message because you are subscribed to the Google
Groups "Crossbar" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to crossbario+...@googlegroups.com
<mailto:crossbario+...@googlegroups.com>.
To post to this group, send email to cross...@googlegroups.com
<mailto:cross...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/crossbario/d137bc11-9b62-455b-b889-e42887b57a65%40googlegroups.com
<https://groups.google.com/d/msgid/crossbario/d137bc11-9b62-455b-b889-e42887b57a65%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#3

Hi Tobias,

That worked well, thanks for your help.

Raffaele

···

On Thursday, January 15, 2015 at 10:00:44 PM UTC+1, Tobias Oberstein wrote:

Hi Raffaele,

Is it possible to publish an event from within an event handler?

Sure. Just do session.publish() where session is an instance of
ApplicationSession

Cheers,

/Tobias

Example:

def doit():

…do some work…

…notify that work is done by publishing another event…

(I tried appSession.publish(WORKDONE)…but it does not seem to work)

yield self.subscribe(doit, DOIT)

Thanks,

Raffaele

You received this message because you are subscribed to the Google

Groups “Crossbar” group.

To unsubscribe from this group and stop receiving emails from it, send

an email to crossbario+...@googlegroups.com

mailto:crossbario+unsub...@googlegroups.com.

To post to this group, send email to cros...@googlegroups.com

mailto:cross...@googlegroups.com.

To view this discussion on the web visit

https://groups.google.com/d/msgid/crossbario/d137bc11-9b62-455b-b889-e42887b57a65%40googlegroups.com

<https://groups.google.com/d/msgid/crossbario/d137bc11-9b62-455b-b889-e42887b57a65%40googlegroups.com?utm_medium=email&utm_source=footer>.

For more options, visit https://groups.google.com/d/optout.

0 Likes