Operation
Object Hierarchy:
Description:
[
CCode ( type_id =
"camel_operation_get_type ()" ) ]
public class Operation :
Cancellable
Progress reporting and cancellation for long-running tasks.
Operation is a bi-directional rendezvous mechanism used to communicate status information from long-running
Camel tasks back to the calling application, and to allow the application to cancel those tasks.
The typical usage pattern is:
- Create a Operation with a status callback.
- Push it onto the current thread with push_message / or use it as a
Cancellable passed to async operations.
- Long-running Camel functions report progress via
camel_operation_progress and check for cancellation via the
Cancellable interface.
- The client can cancel the operation by calling cancel on the
Operation (which is a Cancellable subclass).
Status messages follow a push/pop model: push_message starts a new
operation description (emitting the "status" signal), and camel_operation_pop_message ends it, restoring the previous
description. camel_operation_progress reports percentage-based progress within the current message.
Content:
Static methods:
- public static void cancel_all ()
Cancel all outstanding operations.
- public static string? dup_message (Cancellable? cancellable = null)
Duplicates current operation message, or returns
null, if no such is available.
Creation methods:
- public Operation ()
Create a new camel operation handle.
- public Operation.proxy (Cancellable? cancellable = null)
Proxies the cancellable in a way that if it is cancelled,
then the returned cancellable is also cancelled, but when the returned cancellable is cancelled, then it doesn't influence the
original cancellable.
Methods:
Signals:
Inherited Members:
All known members inherited from class GLib.Cancellable
All known members inherited from class GLib.Object