Infinity.Io¶
- Implementations:
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Infinity.Io¶
- Bases:
- Structure:
Infinity.Io
is an opaque data type. You should only access it via the public API functions.- add_dispatch(func, *user_data)¶
- Parameters:
func (
Infinity.IoDispatchFunc
) – Function to be called when the function is dispatched.
- Returns:
A dispatch handle that can be used to stop the dispatched function from being called as long as it has not yet been called.
- Return type:
Schedules func to be called by the thread self runs in. This function can be used from a different thread to communicate to self's thread.
- add_timeout(msecs, func, *user_data)¶
- Parameters:
msecs (
int
) – Number of milliseconds after which the timeout should be elapsed.func (
Infinity.IoTimeoutFunc
) – Function to be called when the timeout elapsed.
- Returns:
A timeout handle that can be used to remove the timeout.
- Return type:
Calls func after at least msecs milliseconds have elapsed. The timeout is removed after it has elapsed.
- add_watch(socket, events, func, *user_data)¶
- Parameters:
socket (
int
) – The socket to watch.events (
Infinity.IoEvent
) – Events to watch for.func (
Infinity.IoWatchFunc
) – Function to be called when one of the events occurs.
- Returns:
A
Infinity.IoWatch
that can be used to update or remove the watch.- Return type:
Monitors the given socket for activity and calls func if one of the events specified in events occurs.
- add_watch_from_fd(fd, events, func, *user_data)¶
- Parameters:
fd (
int
) – The file descriptor to watch.events (
Infinity.IoEvent
) – Events to watch for.func (
Infinity.IoWatchFunc
) – Function to be called when one of the events occurs.
- Returns:
A
Infinity.IoWatch
that can be used to update or remove the watch.- Return type:
Monitors the given file descriptor for activity and calls func if one of the events specified in events occurs. This is equivalent to
Infinity.Io.add_watch
() for a socket that represents the given file descriptor, but takes care of the memory management of the file descriptor. This function is especially intended for language bindings. It is only available on unix-like operating systems.
- remove_dispatch(dispatch)¶
- Parameters:
dispatch (
Infinity.IoDispatch
) – A dispatch handle obtained fromInfinity.Io.add_dispatch
().
Removes the given dispatch from self so that it is not called.
- remove_timeout(timeout)¶
- Parameters:
timeout (
Infinity.IoTimeout
) – A timeout handle obtained fromInfinity.Io.add_timeout
().
Removes the given timeout.
- remove_watch(watch)¶
- Parameters:
watch (
Infinity.IoWatch
) – The watch to remove, as returned byInfinity.Io.add_watch
().
Removes watch from self and releases all resources allocated for the watch. Events are no longer looked for on the socket.
- update_watch(watch, events)¶
- Parameters:
watch (
Infinity.IoWatch
) – The watch to update, as returned byInfinity.Io.add_watch
().events (
Infinity.IoEvent
) – The new events to watch for.
Changes the events that the socket bound to watch is being watched for. The callback of watch will only be called if one of the newly watched for events occurs.
- do_add_dispatch(func, *user_data) virtual¶
- Parameters:
func (
Infinity.IoDispatchFunc
) – Function to be called when the function is dispatched.
- Returns:
A dispatch handle that can be used to stop the dispatched function from being called as long as it has not yet been called.
- Return type:
Schedules func to be called by the thread io runs in. This function can be used from a different thread to communicate to io's thread.
- do_add_timeout(msecs, func, *user_data) virtual¶
- Parameters:
msecs (
int
) – Number of milliseconds after which the timeout should be elapsed.func (
Infinity.IoTimeoutFunc
) – Function to be called when the timeout elapsed.
- Returns:
A timeout handle that can be used to remove the timeout.
- Return type:
Calls func after at least msecs milliseconds have elapsed. The timeout is removed after it has elapsed.
- do_add_watch(socket, events, func, *user_data) virtual¶
- Parameters:
socket (
int
) – The socket to watch.events (
Infinity.IoEvent
) – Events to watch for.func (
Infinity.IoWatchFunc
) – Function to be called when one of the events occurs.
- Returns:
A
Infinity.IoWatch
that can be used to update or remove the watch.- Return type:
Monitors the given socket for activity and calls func if one of the events specified in events occurs.
- do_remove_dispatch(dispatch) virtual¶
- Parameters:
dispatch (
Infinity.IoDispatch
) – A dispatch handle obtained fromInfinity.Io.add_dispatch
().
Removes the given dispatch from io so that it is not called.
- do_remove_timeout(timeout) virtual¶
- Parameters:
timeout (
Infinity.IoTimeout
) – A timeout handle obtained fromInfinity.Io.add_timeout
().
Removes the given timeout.
- do_remove_watch(watch) virtual¶
- Parameters:
watch (
Infinity.IoWatch
) – The watch to remove, as returned byInfinity.Io.add_watch
().
Removes watch from io and releases all resources allocated for the watch. Events are no longer looked for on the socket.
- do_update_watch(watch, events) virtual¶
- Parameters:
watch (
Infinity.IoWatch
) – The watch to update, as returned byInfinity.Io.add_watch
().events (
Infinity.IoEvent
) – The new events to watch for.
Changes the events that the socket bound to watch is being watched for. The callback of watch will only be called if one of the newly watched for events occurs.