Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 655 Bytes

ReadmeAdvanced.md

File metadata and controls

21 lines (15 loc) · 655 Bytes

Overview

This Documentation is for internal use only. It describes functionality that must only be used by 'pro' users.

Usage

Update TTL Of Data

Following code can be used to update the time to live of data inside the DataBuffer.

from bsread import dispatcher
import datetime

channels = ["CHAN_A", "CHAN_B"]
ttl = datetime.timedelta(weeks=1)  # keep data for 1 week

timestamp = datetime.datetime.now()
start = timestamp - datetime.timedelta(seconds=1)  # keep 1 second worth of data before now
end = timestamp + datetime.timedelta(seconds=0.1)  # 1 second safety margin

dispatcher.update_time_to_live(channels, start, end, ttl)