View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Marc A. Lehmann > Glib-EV-2.02 > Glib::EV



Annotate this POD

View/Report Bugs
Module Version: 2.02   Source  


Glib::EV - Coerce Glib into using the EV module as event loop.


 use Glib::EV;

 # example with Gtk2:
 use Gtk2 -init;
 use Glib::EV;
 use EV; # any order
 my $timer = EV::timer 1, 1, sub { print "I am here!\n" };
 main Gtk2;
 # etc., it just works

 # You can even move the glib mainloop into a coroutine:
 use Gtk2 -init;
 use Coro;
 use Coro::EV;
 use Glib::EV;
 async { main Gtk2 };
 # ... do other things


If you want to use glib/gtk+ in an EV program, then you need to look at the EV::Glib module, not this one, as this module requires you to run a Glib or Gtk+ main loop in your program.

If you want to use EV in an Glib/Gtk+ program, you are at the right place here.

This module coerces the Glib event loop to use the EV high performance event loop as underlying event loop, i.e. EV will be used by Glib for all events.

This makes Glib compatible to EV. Calls into the Glib main loop are more or less equivalent to calls to EV::loop (but not vice versa, you have to use the Glib mainloop functions).


  * No documented API to patch other main contexts.


EV, Glib, Glib::MainLoop.


 Marc Lehmann <>
syntax highlighting: