Publish from an event handler (Python)

21 مرّة مشاهدة
التخطي إلى أول رسالة غير مقروءة

Raffaele Bianco

غير مقروءة،
15‏/01‏/2015، 10:54:50 ص15‏/1‏/2015
إلى cross...@googlegroups.com

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

Tobias Oberstein

غير مقروءة،
15‏/01‏/2015، 4:00:44 م15‏/1‏/2015
إلى cross...@googlegroups.com
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.

Raffaele Bianco

غير مقروءة،
16‏/01‏/2015، 9:37:59 ص16‏/1‏/2015
إلى cross...@googlegroups.com
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
الرد على الكل
رد على الكاتب
إعادة توجيه
0 رسالة جديدة