code: public TaskRec eventQueueReserveTask(long taskId) {
  		String sqlLogId = "reserve_task";
  		String sql = "update tedtask set status = 'WORK', startTs = $now, nextTs = null"
  				+ " where status in ('NEW','RETRY') and system = '$sys'"
  				+ " and taskid in ("
  				+ " select taskid from tedtask "
  					+ " where status in ('NEW','RETRY') and system = '$sys'"
  					+ " and taskid = ?"
  					+ " for update skip locked"
  				+ ") returning tedtask.*"
  				;
  		sql = sql.replace("$now", dbType.sql.now());
  		sql = sql.replace("$sys", thisSystem);
  		List<TaskRec> tasks = selectData(sqlLogId, sql, TaskRec.class, asList(
  				sqlParam(taskId, JetJdbcParamType.LONG)
  		));
  		return tasks.isEmpty() ? null : tasks.get(0);
  	}
docs: used in eventQueue