use of io.zeebe.map.iterator.Long2BytesZbMapEntry in project zeebe by zeebe-io.
the class TaskExpireLockStreamProcessor method timeOutTasks.
private void timeOutTasks() {
final Iterator<Long2BytesZbMapEntry> iterator = expirationMap.iterator();
while (iterator.hasNext()) {
final Long2BytesZbMapEntry entry = iterator.next();
final DirectBuffer value = entry.getValue();
final long eventPosition = value.getLong(0);
final long lockExpirationTime = value.getLong(SIZE_OF_LONG);
if (lockExpired(lockExpirationTime)) {
// TODO: would be nicer to have a consumable channel for timed-out timers
// that we can stop consuming/yield on backpressure
final boolean success = streamWriter.tryWriteTaskEvent(eventPosition, TaskState.EXPIRE_LOCK);
if (!success) {
return;
}
}
}
}
Aggregations