akka.net
akka.net copied to clipboard
[WIP] Akka.IO / Akka.Streams: `ByteString` rewrite
Changes
A leftover milestone from v1.5 - we are dragging ByteString kicking and screaming into the .NET Core era with major refactoring, namely replacing all of its internals ReadOnlyMemory<byte> usage.
Checklist
For significant changes, please ensure that the following have been completed (delete if not relevant):
- [ ] This change follows the Akka.NET API Compatibility Guidelines.
- [ ] This change follows the Akka.NET Wire Compatibility Guidelines.
- [ ] I have reviewed my own pull request.
- [ ] Design discussion issue #
- [ ] Changes in public API reviewed, if any.
- [ ] I have added website documentation for this feature.
Latest dev Benchmarks
Include data from the relevant benchmark prior to this change here.
This PR's Benchmarks
Include data from after this change here.
Tests are not currently compiling - working on that.
Let's see how accurately ChatGPT was able to describe the current FSM behavior of Akka.IO's TcpConnection actor, one of the areas I'm looking to refactor:
stateDiagram-v2
[*] --> WaitingForRegistration: Connection established
WaitingForRegistration --> Connected: Register
WaitingForRegistration --> Closing: CloseCommand
WaitingForRegistration --> WaitingForRegistration: ResumeReading / SuspendReading
Connected --> ClosingWithPendingWrite: CloseCommand with pending write
Connected --> PeerSentEOF: PeerClosed (keep open)
Connected --> Closing: CloseCommand
Connected --> Connected: WriteCommand / SocketSent / SuspendReading / ResumeReading
PeerSentEOF --> Closing: CloseCommand
ClosingWithPendingWrite --> Closing: Write completed
Closing --> Closed: Connection closed
Closed --> [*]
Honestly, not a bad job ChatGPT ^
Looks like SocketAsyncEventArgs is still the way to go for high performance sockets in .NET: https://twitter.com/_MihaZupan/status/1774911865019113974
Gonna need to redo this - stuff like the framing code is phenomenally messy and difficult to reason about. That needs to be refactored and simplified first.