Skip to content

Commit

Permalink
reorder struct fields
Browse files Browse the repository at this point in the history
  • Loading branch information
soypat committed May 31, 2023
1 parent e738d0f commit 7aa02cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ var (
// Client is a asynchronous MQTT v3.1.1 client implementation which is
// safe for concurrent use.
type Client struct {
cs clientState
txlock sync.Mutex
cs clientState

rxlock sync.Mutex
rx Rx

txlock sync.Mutex
tx Tx
}

Expand Down
6 changes: 2 additions & 4 deletions rxtx.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,17 @@ import (
//
// Not safe for concurrent use.
type Rx struct {
// LastReceivedHeader contains the last correctly read header.
LastReceivedHeader Header
// Transport over which packets are read and written to.
// Not exported since RxTx type might be composed of embedded Rx and Tx types in future. TBD.
rxTrp io.ReadCloser
RxCallbacks RxCallbacks
// User defined decoder for allocating packets.
userDecoder Decoder
// Default decoder for non allocating packets.
dec DecoderNoAlloc
// ScratchBuf is lazily allocated to exhaust Publish payloads when received and no
// OnPub callback is set.
ScratchBuf []byte
// LastReceivedHeader contains the last correctly read header.
LastReceivedHeader Header
}

// RxCallbacks groups all functionality executed on data receipt, both successful
Expand Down

0 comments on commit 7aa02cb

Please sign in to comment.