-
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.
Cleaned up usages of messages and standardized returning to the cache…
… via IDisposable interface.
- Loading branch information
Showing
24 changed files
with
342 additions
and
223 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Buffers; | ||
using NexNet.Messages; | ||
|
||
namespace NexNet.Cache; | ||
|
||
/// <summary> | ||
/// Defines the operations for a cache that stores and manages messages. | ||
/// </summary> | ||
internal interface ICachedMessage | ||
{ | ||
/// <summary> | ||
/// Clears all the messages from the cache. | ||
/// </summary> | ||
void Clear(); | ||
|
||
/// <summary> | ||
/// Deserializes the given sequence of bytes into a message. | ||
/// </summary> | ||
/// <param name="bodySequence">The sequence of bytes to be deserialized.</param> | ||
/// <returns>The deserialized message.</returns> | ||
IMessageBase DeserializeInterface(in ReadOnlySequence<byte> bodySequence); | ||
|
||
|
||
/// <summary> | ||
/// Returns the specified message item back to the cache. | ||
/// </summary> | ||
/// <param name="item">The message item to be returned to the cache.</param> | ||
void Return(IMessageBase item); | ||
} |
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
Oops, something went wrong.