From 874ae2e01156a178c5be07a04028cd8f2a21eda5 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 19 Nov 2025 20:56:16 -0500 Subject: [PATCH] Update Trans docs with new concurrency rules --- connection.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/connection.go b/connection.go index 07eb829..3ac317a 100644 --- a/connection.go +++ b/connection.go @@ -34,8 +34,8 @@ type Conn interface { } // Trans is a HOPP transaction. Methods of this interface are not safe for -// concurrent use with the exception of the Close and ID methods. The -// recommended use case is one goroutine per transaction. +// concurrent use with the exception of the Write, SendWriter, Close, and ID +// methods. The recommended use case is one goroutine per transaction. type Trans interface { // Close closes the transaction. Any blocked operations will be // unblocked and return errors. This method is safe for concurrent use. @@ -45,13 +45,13 @@ type Trans interface { // unique within the connection. This method is safe for concurrent use. ID() int64 - // Send sends a message. This method is not safe for concurrent use. + // Send sends a message. This method is safe for concurrent use. Send(method uint16, data []byte) error // SendWriter sends data written to an [io.Writer]. The writer must be // closed after use. Closing the writer flushes any data that hasn't // been written yet. Any writer previously opened through this function - // will be discarded. This method is not safe for concurrent use, and - // neither is its result. + // will be discarded. This method is safe for concurrent use, but its + // result isn't. SendWriter(method uint16) (io.WriteCloser, error) // Receive receives a message. This method is not safe for concurrent // use.