Add a query to the BatchOperation, to be executed when the operation is run.
The query will return a Entry (of subclass type entry_type
) representing the
given entry id
. The ID is of the same format as that returned by get_id.
Note that a single batch operation should not operate on a given Entry more than once, as there's no guarantee about the order in which the batch operation's operations will be performed.
callback
will be called when the BatchOperation is run with
run (in which case it will be called in the thread which ran the batch
operation), or with run_async (in which case it will be called in an idle
handler in the main thread). The operation_id
passed to the callback will match the return value of
add_query, and the operation_type
will be QUERY.
If the query was successful, the resulting entry will be passed to the callback function as entry
, and error
will be null
. If, however, the query was unsuccessful, entry
will be null
and error
will contain a Error detailing what went wrong.
this | |
id |
the ID of the entry being queried for |
entry_type |
the type of the entry which will be returned |
callback |
a BatchOperationCallback to call when the query is finished, or
|
user_data |
data to pass to the |
operation ID for the added query, or |