-
Notifications
You must be signed in to change notification settings - Fork 1
system.poller
load system.poller
This module provides the System.Poller class which allows to wait for multiple events at the same time.
This class provides mechanisms to wait for multiple events.
An instance of System.Poller watch a set of events. Severals instances of the class can be created to manage distinct sets.
The watched event objects must provide a getHandle method that return an instance of mint::handle_t.
| Modifiers | Member | Description |
|---|---|---|
const |
new | Creates a new poller object. |
const |
poll | Waits until at least one of the watched events is set. If timeout is given, t... |
const |
run | Runs a polling loop that calls System.Poller.poll until no more event is watc... |
const |
unwatch | Removes the object from the watcher. Returns true if event is watched by the ... |
const |
watch | Adds an object to the watcher. The object object must provides a getPollEvent... |
| Modifiers | Member | Description |
|---|---|---|
@ const
|
eventFromObject | Returns the event handle from the given object. The object must provide a get... |
| Modifiers | Member | Description |
|---|---|---|
class |
PollDescriptor | Internal poll context structure. |
final |
d_ptr | Object data. |
final |
events | Internal set of watched event objects. |
@ const
|
g_lib | Global library handle. |
Internal poll context structure.
| Modifiers | Member | Description |
|---|---|---|
| callback | Callback to call when the event is triggered. | |
| event | Event handle. | |
const |
new | Creates a new context for the given event object. |
| object | Event object. |
none
Callback to call when the event is triggered.
null
Event handle.
def (self, object)
Creates a new context for the given event object.
null
Event object.
null
Object data.
def (object)
Returns the event handle from the given object. The object must provide a getHandle method. If the object
provides a getPollEvent method, it is called to get the event handle.
{}
Internal set of watched event objects.
lib ('libmint-system')
Global library handle.
def (self)
Creates a new poller object.
def (self, timeout = none)
Waits until at least one of the watched events is set. If timeout is given, the wait stop after timeout
milliseconds if no event is set. The callback of each set event is called.
Returns true if at least one event is set; otherwise returns false.
An instance of Exception.SystemError is raised on error.
def (self, timeout = 500)
Runs a polling loop that calls poll until no more event is watched. The timeout parameter is
forwarded to the called method.
def (self, object)
Removes the object from the watcher. Returns true if event is watched by the watcher; otherwise returns
false.
An instance of Exception.SystemError is raised on error.
def (self, object, callback)
Adds an object to the watcher. The object object must provides a getPollEvent or getHandle method.
When the event associated to object is triggered, callback will ba called by poll. Returns true
if object is successfully watched; otherwise returns false.
An instance of Exception.SystemError is raised on error.
- Introduction
- Variables
-
Built-in-types
- Built-in-types#none
- Built-in-types#null
- Built-in-types#boolean
- Built-in-types#number
- Built-in-types#string
- Built-in-types#regex
- Built-in-types#array
- Built-in-types#hash
- Built-in-types#iterator
- Built-in-types#async_iterator
- Built-in-types#package
- Built-in-types#function
- Built-in-types#coroutine
- Built-in-types#library
- Built-in-types#libobject
- Arithmetic-operations
- Type-casting
- Control-structures
- Function-definition
- User-defined-types
- Work-with-modules