(self, curs)
return self.batch_info['batch_id']
Allocate next batch. (internal)
Allocate next batch. (internal)
Allocate next batch . ( internal )
def _load_next_batch(self, curs):
        """Allocate next batch. (internal)"""

        q = """select * from pgq.next_batch_custom(%s, %s, %s, %s, %s)"""
        curs.execute(q, [self.queue_name, self.consumer_name,
                         self.pgq_min_lag, self.pgq_min_count, self.pgq_min_interval])
        inf = curs.fetchone().copy()
        inf['tick_id'] = inf['cur_tick_id']
        inf['batch_end'] = inf['cur_tick_time']
        inf['batch_start'] = inf['prev_tick_time']
        inf['seq_start'] = inf['prev_tick_event_seq']
        inf['seq_end'] = inf['cur_tick_event_seq']
        self.batch_info = inf
        return self.batch_info['batch_id']
def _load_next_batch ( self , curs ) : q = """select * from pgq.next_batch_custom(%s, %s, %s, %s, %s)""" curs . execute ( q , [ self . queue_name , self . consumer_name , self . pgq_min_lag , self . pgq_min_count , self . pgq_min_interval ] ) inf = curs . fetchone ( ) . copy ( ) inf [ 'tick_id' ] = inf [ 'cur_tick_id' ] inf [ 'batch_end' ] = inf [ 'cur_tick_time' ] inf [ 'batch_start' ] = inf [ 'prev_tick_time' ] inf [ 'seq_start' ] = inf [ 'prev_tick_event_seq' ] inf [ 'seq_end' ] = inf [ 'cur_tick_event_seq' ] self . batch_info = inf return self . batch_info [ 'batch_id' ]