tranger2_open_rt_disk()

tranger2_open_rt_disk()#

Opens a real-time disk-based iterator for monitoring changes in a topic. The function allows tracking new records appended to the topic by monitoring disk events.

Prototype

json_t *tranger2_open_rt_disk(
    json_t *tranger,
    const char *topic_name,
    const char *key,        // if empty receives all keys, else only this key
    json_t *match_cond,     // owned
    tranger2_load_record_callback_t load_record_callback,   // called on append new record on disk
    const char *rt_id,      // rt disk id, REQUIRED
    const char *creator,
    json_t *extra           // owned, user data, this json will be added to the return iterator
);

Parameters

Key

Type

Description

tranger

json_t *

Pointer to the TimeRanger database instance.

topic_name

const char *

Name of the topic to monitor.

key

const char *

Specific key to monitor. If empty, all keys are monitored.

match_cond

json_t *

JSON object containing conditions for filtering records. Owned by the function.

load_record_callback

tranger2_load_record_callback_t

Callback function invoked when a new record is appended to the disk.

rt_id

const char *

Unique identifier for the real-time disk iterator. Required.

creator

const char *

Identifier of the entity creating the iterator.

extra

json_t *

Additional user data to be associated with the iterator. Owned by the function.


Return Value

Returns a JSON object representing the real-time disk iterator. The caller does not own the returned object.

Notes

This function is used when monitoring real-time changes in a topic via disk events. The iterator remains active until explicitly closed using tranger2_close_rt_disk().

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples