@Override protected void sendCancel() { // Clear lua input queue to ensure cancel is accepted. inputQueue.clear(); resultSet.abort(); // Send end command to lua input queue. // It's critical that the end offer succeeds. while (! inputQueue.offer(LuaValue.NIL)) { // Queue must be full. Remove one item to make room. if (inputQueue.poll() == null) { // Can't offer or poll. Nothing further can be done. if (Log.debugEnabled()) { Log.debug("Lua input queue " + statement.taskId + " both offer and poll failed on abort"); } break; } } }
@Override protected void sendCancel() { // Clear lua input queue to ensure cancel is accepted. inputQueue.clear(); resultSet.abort(); // Send end command to lua input queue. // It's critical that the end offer succeeds. while (! inputQueue.offer(LuaValue.NIL)) { // Queue must be full. Remove one item to make room. if (inputQueue.poll() == null) { // Can't offer or poll. Nothing further can be done. if (Log.debugEnabled()) { Log.debug("Lua input queue " + statement.taskId + " both offer and poll failed on abort"); } break; } } }
/** * Put object on the queue. */ public final boolean put(Object object) { if (! valid) { return false; } try { // This put will block if queue capacity is reached. queue.put(object); return true; } catch (InterruptedException ie) { if (Log.debugEnabled()) { Log.debug("ResultSet " + executor.statement.taskId + " put interrupted"); } // Valid may have changed. Check again. if (valid) { abort(); } return false; } }
/** * Put object on the queue. */ public final boolean put(Object object) { if (! valid) { return false; } try { // This put will block if queue capacity is reached. queue.put(object); return true; } catch (InterruptedException ie) { if (Log.debugEnabled()) { Log.debug("ResultSet " + executor.statement.taskId + " put interrupted"); } // Valid may have changed. Check again. if (valid) { abort(); } return false; } }