开发者

Signal/Slot mechanism for Perl

开发者 https://www.devze.com 2023-01-03 13:51 出处:网络
I\'m wondering if there is an equivalent to Qt\'s signal/slot mechanism for Perl.I have looked into POE, but since it\'s huge, I couldn\'t find anything use开发者_JS百科ful.

I'm wondering if there is an equivalent to Qt's signal/slot mechanism for Perl. I have looked into POE, but since it's huge, I couldn't find anything use开发者_JS百科ful.

Thank you in advance,


Perhaps you are looking for something like Object::Event, an API for registering and emitting events, mostly for AnyEvent, but I imagine you could use it elsewhere. Gtk2 also has a mechanism similar to QT's, especially combined with Glade XML, which lets you automatically map event slots|signals to perl object methods or functions. AnyEvent is a generic event loop which supports Gtk/Glib and POE, amongst others, and is much easier to grok than the large set of modules that is POE.


The concept is generally called Publish/Subscribe. The search result for pubsub on CPAN gives you what you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消