-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize out busy wait writer, other minor fixes
- Loading branch information
Showing
21 changed files
with
640 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/name/maxdeliso/teflon/net/MessageSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package name.maxdeliso.teflon.net; | ||
|
||
import java.nio.ByteBuffer; | ||
|
||
/** | ||
* Interface for sourcing messages with peek and poll operations. | ||
* This allows for checking message availability without consuming them, | ||
* and consuming them only when they are successfully sent. | ||
*/ | ||
public interface MessageSource { | ||
/** | ||
* Peeks at the next message without consuming it. | ||
* | ||
* @return The next message as a ByteBuffer, or null if no message is available | ||
*/ | ||
ByteBuffer peek(); | ||
|
||
/** | ||
* Consumes and returns the next message. | ||
* This should be called only after a successful peek() and send. | ||
* | ||
* @return The next message as a ByteBuffer, or null if no message is available | ||
*/ | ||
ByteBuffer poll(); | ||
} |
Oops, something went wrong.