Interface WriteRequestQueue
- All Known Implementing Classes:
DefaultIoSessionDataStructureFactory.DefaultWriteRequestQueue
public interface WriteRequestQueue
Stores
WriteRequests which are queued to an IoSession.-
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all the requests from this session's queue.voidDisposes any releases associated with the specified session.booleanTells if the WriteRequest queue is empty or not for a sessionvoidoffer(IoSession session, WriteRequest writeRequest) Add a new WriteRequest to the session write's queueGet the first request available in the queue for a session.intsize()
-
Method Details
-
poll
Get the first request available in the queue for a session.- Parameters:
session- The session- Returns:
- The first available request, if any.
-
offer
Add a new WriteRequest to the session write's queue- Parameters:
session- The sessionwriteRequest- The writeRequest to add
-
isEmpty
Tells if the WriteRequest queue is empty or not for a session- Parameters:
session- The session to check- Returns:
trueif the writeRequest is empty
-
clear
Removes all the requests from this session's queue.- Parameters:
session- The associated session
-
dispose
Disposes any releases associated with the specified session. This method is invoked on disconnection.- Parameters:
session- The associated session
-
size
int size()- Returns:
- the number of objects currently stored in the queue.
-