Package com.yahoo.io
Class UpdateInterest
- java.lang.Object
-
- com.yahoo.io.UpdateInterest
-
public class UpdateInterest extends java.lang.Object
Command object to perform interest set updates. Workaround for NIO design flaw which makes it impossible to update the interest set of a SelectionKey while select() is in progress. There should be a more elegant way around this, but if it turns out to be performant enough we leave it like this.Of course, the ideal would be to have NIO fixed.
- Author:
- Bob Travis, Bjorn Borud
-
-
Constructor Summary
Constructors Constructor Description UpdateInterest(java.nio.channels.SelectionKey key, int operation, boolean set)
Create an object for encapsulating a interest set change request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doUpdate()
This method is used for actually applying the updates to the SelectionKey in question at a time when it is safe to do so.
-
-
-
Constructor Detail
-
UpdateInterest
public UpdateInterest(java.nio.channels.SelectionKey key, int operation, boolean set)
Create an object for encapsulating a interest set change request.- Parameters:
key
- The key we wish to updateoperation
- The operation we wish to set or removeset
- Whether we want to set (true) or clear (false) the operation in the interest set
-
-