added comments

This commit is contained in:
Robinson 2023-06-07 11:49:01 +02:00
parent 25db1740f8
commit 7bde7ac3df
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 7 additions and 1 deletions

View File

@ -65,7 +65,13 @@ internal class ClientHandshake<CONNECTION: Connection>(
private var failedException: Exception? = null
init {
// now we have a bi-directional connection with the server on the handshake "socket".
// NOTE: subscriptions (ie: reading from buffers, etc) are not thread safe! Because it is ambiguous HOW EXACTLY they are unsafe,
// we exclusively read from the DirectBuffer on a single thread.
// NOTE: Handlers are called on the client conductor thread. The client conductor thread expects handlers to do safe
// publication of any state to other threads and not be:
// - long running
// - re-entrant with the client
handler = FragmentAssembler { buffer: DirectBuffer, offset: Int, length: Int, header: Header ->
// this is processed on the thread that calls "poll". Subscriptions are NOT multi-thread safe!
val sessionId = header.sessionId()