The event_base lies at the center of Libevent; every application will have one. It keeps track of all pending and active events, and notifies your application of the active ones.
libevent :: NativeEventBase :: new
Create a new event_base to use with the rest of Libeventlibevent $ NativeEventBase :: SELF
Type of this instance, automatically specialized in every classcore :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
core :: Pointer :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
libevent :: NativeEventBase :: new
Create a new event_base to use with the rest of Libeventcore :: Object :: output_class_name
Display class name on stdout (debug only).
# Structure to hold information and state for a Libevent dispatch loop.
#
# The event_base lies at the center of Libevent; every application will
# have one. It keeps track of all pending and active events, and
# notifies your application of the active ones.
extern class NativeEventBase `{ struct event_base * `}
# Create a new event_base to use with the rest of Libevent
new `{ return event_base_new(); `}
# Has `self` been correctly initialized?
fun is_valid: Bool do return not address_is_null
# Reinitialize the event base after a fork
#
# Some event mechanisms do not survive across fork.
# The event base needs to be reinitialized with the `reinit` method.
#
# Returns `true` if some events could not be re-added.
fun reinit: Bool `{ return event_reinit(self); `}
# Event dispatching loop
#
# This loop will run the event base until either there are no more added
# events, or until something calls `loopexit`.
fun dispatch `{ event_base_dispatch(self); `}
# Exit the event loop
#
# TODO support timer
fun loopexit `{ event_base_loopexit(self, NULL); `}
redef fun free `{ event_base_free(self); `}
end
lib/libevent/libevent.nit:83,1--116,3