def TruncateTopic(timestamp):
    global Running;
    global Exit_Code;
    try : 
        Subscriber = Synapse_subscriber(Basic_waypoints_factory(), Message_factory_type())
        yield Subscriber.Open(Synapse_host, Synapse_port, 15)
        trunc_time = 1470120000000000
        if (timestamp != 0):
            trunc_time = timestamp * 1000000;
        yield Subscriber._DONT_USE_JUST_YET_Set_topic_sparsification("test.topic", 0, trunc_time)
        yield Subscriber.Close();
    except Exception, e :
        print("Error: " + str(e));
        Exit_Code = -1
Esempio n. 2
0
def Truncate_topic(topic, size, timestamp):
    global Running
    global Exit_Code
    try:
        Subscriber = Synapse_subscriber(Basic_waypoints_factory(),
                                        Message_factory_type())
        yield Subscriber.Open(Synapse_host, Synapse_port, 15)
        trunc_time = 1470120000000000
        if (timestamp != 0):
            trunc_time = timestamp * 1000000
        print("Truncate topic " + topic + " at " + str(trunc_time))

        yield Subscriber._DONT_USE_JUST_YET_Set_topic_sparsification(
            topic, size, trunc_time)
        yield Subscriber.Close()
    except Exception, e:
        print("Error: " + str(e))
        Exit_Code = -1