Callbacks

AdoptedStateVectorForeachFunc (id, value, *user_data)

AsyncOperationDoneFunc (run_data, *user_data)

AsyncOperationRunFunc (run_data, run_notify, *user_data)

DiscoveryResolvCompleteFunc (info, connection, error, *user_data)

FileListFunc (name, path, type, *user_data)

IoDispatchFunc (*user_data)

IoTimeoutFunc (*user_data)

IoWatchFunc (socket, event, *user_data)

RequestFunc (request, result, error, *user_data)

SaslContextCallbackFunc (session, property, session_data, *user_data)

SaslContextSessionFeedFunc (session, data, needs_more, error, *user_data)

UserTableForeachUserFunc (user, *user_data)

Details

Infinity.AdoptedStateVectorForeachFunc(id, value, *user_data)
Parameters:

This function is called for every component in the state vector during the invocation of Infinity.AdoptedStateVector.foreach().

Infinity.AsyncOperationDoneFunc(run_data, *user_data)
Parameters:

This function is called in the main thread once the asynchronous operation has finished.

Infinity.AsyncOperationRunFunc(run_data, run_notify, *user_data)
Parameters:

This function performs the asynchronous task and is executed in a separate thread. The pointer written into run_data is passed back to the main thread after the function has finished executing.

Infinity.DiscoveryResolvCompleteFunc(info, connection, error, *user_data)
Parameters:

This callback is called when a call to Infinity.Discovery.resolve() finished.

Infinity.FileListFunc(name, path, type, *user_data)
Parameters:
  • name (str) – The name of the current file.

  • path (str) – The full path to the current file.

  • type (Infinity.FileType) – The type of the current file.

  • user_data (object or None) – User data specified at the time of the call.

Returns:

True if the iteration should be continued or False otherwise.

Return type:

bool

This is the prototype of the callback function passed to Infinity.file_util_list_directory(). If the function returns False then directory traversal is stopped immediately. In addition error can be set and it is propagated to the caller of Infinity.file_util_list_directory().

Infinity.IoDispatchFunc(*user_data)
Parameters:

user_data (object or None) – User-defined data specified in Infinity.Io.add_dispatch().

Callback function that is called when a dispatch is executed by the thread that runs Infinity.Io.

Infinity.IoTimeoutFunc(*user_data)
Parameters:

user_data (object or None) – User-defined data specified in Infinity.Io.add_timeout().

Callback function that is called when a timeout has elapsed.

Infinity.IoWatchFunc(socket, event, *user_data)
Parameters:

Callback function that is called when an event occurs on a watched socket.

Infinity.RequestFunc(request, result, error, *user_data)
Parameters:

Signature of a signal handler for the Infinity.Request ::finished signal.

Infinity.SaslContextCallbackFunc(session, property, session_data, *user_data)
Parameters:

This callback is called whenever a property is required to proceed with authentication. For example, when a password is required, the callback is called with property set to %GSASL_PASSCODE.

The function is then expected to set that property using Infinity.SaslContextSession.set_property() and, once it is done, call Infinity.SaslContextSession.continue_(). This can happen fully asynchronously, that is it does not need to take place directly within the callback but the callback can, for example, open a dialog for the user to enter a password and then once the user closes the dialog call the two functions mentioned above.

Infinity.SaslContextSessionFeedFunc(session, data, needs_more, error, *user_data)
Parameters:

This function is called in response to Infinity.SaslContextSession.feed(). When all required properties (if any) have been provided by the callback function then this function is called with the response to send to the remote site.

If an error occurred then error will be set and data will be None.

Infinity.UserTableForeachUserFunc(user, *user_data)
Parameters:

This callback is called for every user iterated by Infinity.UserTable.foreach_user() or Infinity.UserTable.foreach_local_user().