Infinity.Io

g GObject.GInterface GObject.GInterface Infinity.Io Infinity.Io GObject.GInterface->Infinity.Io

Implementations:

Infinity.StandaloneIo

Methods

add_dispatch (func, *user_data)

add_timeout (msecs, func, *user_data)

add_watch (socket, events, func, *user_data)

add_watch_from_fd (fd, events, func, *user_data)

remove_dispatch (dispatch)

remove_timeout (timeout)

remove_watch (watch)

update_watch (watch, events)

Virtual Methods

do_add_dispatch (func, *user_data)

do_add_timeout (msecs, func, *user_data)

do_add_watch (socket, events, func, *user_data)

do_remove_dispatch (dispatch)

do_remove_timeout (timeout)

do_remove_watch (watch)

do_update_watch (watch, events)

Properties

None

Signals

None

Fields

None

Class Details

class Infinity.Io
Bases:

GObject.GInterface

Structure:

Infinity.IoInterface

Infinity.Io is an opaque data type. You should only access it via the public API functions.

add_dispatch(func, *user_data)
Parameters:
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:

Infinity.IoDispatch

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.

  • user_data (object or None) – Extra data to pass to func.

Returns:

A timeout handle that can be used to remove the timeout.

Return type:

Infinity.IoTimeout

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:
Returns:

A Infinity.IoWatch that can be used to update or remove the watch.

Return type:

Infinity.IoWatch

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:
Returns:

A Infinity.IoWatch that can be used to update or remove the watch.

Return type:

Infinity.IoWatch

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 from Infinity.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 from Infinity.Io.add_timeout().

Removes the given timeout.

remove_watch(watch)
Parameters:

watch (Infinity.IoWatch) – The watch to remove, as returned by Infinity.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:

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:
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:

Infinity.IoDispatch

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.

  • user_data (object or None) – Extra data to pass to func.

Returns:

A timeout handle that can be used to remove the timeout.

Return type:

Infinity.IoTimeout

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:
Returns:

A Infinity.IoWatch that can be used to update or remove the watch.

Return type:

Infinity.IoWatch

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 from Infinity.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 from Infinity.Io.add_timeout().

Removes the given timeout.

do_remove_watch(watch) virtual
Parameters:

watch (Infinity.IoWatch) – The watch to remove, as returned by Infinity.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:

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.