Click Tag to Display Pages: development

TimeBase allows clients to subscribe to live data based on types, streams and symbols (entities) attributes, and change their subscription at any time.

There are three possible scenarios:


Subscription starts at some point of time (close to real-time) when the command reaches the server.

This scenario may be applied in case precise subscription timing and order is not critical.

// change entity entity
cursor.removeEntity(new ConstantIdentityKey("CLX20"));
cursor.addEntity(new ConstantIdentityKey("CLZ20"));
// add descriptor
// add stream
TickStream stream = Arrays.stream(tickDB.listStreams())
    .filter(item -> "SmartMetersOhio".equals(item.getKey()))
    .orElseThrow(() -> new IllegalStateException("Stream was not found"));

Precise Subscription Timing

This scenario may be applied in case it is critical to set the precise timing of a new subscription.

In this case, the subscribed data arrives precisely at the specified time but there is no guarantee as for the data ordering.

// specify time for newly subscribed data
cursor.addEntity(new ConstantIdentityKey("TrafficLight-4419"));

Complete Reset

This scenario may be applied in case precise subscription timing and order are required.

It is slowest case due to the complete reset of all buffers.

Reset is performed at a specified time, starting from which you will receive data with the precise time and order.

// reset cursor
String[] symbolsToAdd = new String[] {"Meter-1", "Meter-2", "Meter-3"};
        .map(item -> new ConstantIdentityKey(item))
        .toArray(IdentityKey[]::new), 0, symbolsToAdd.length);