Skip to content

Commit

Permalink
RxPortal; Close (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Aug 26, 2021
1 parent 858ba31 commit 8572db4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rxportal.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type RxPortal struct {
txp *TxPortal
seq *util.Sequence
closer *Closer
closed bool
}

type RxRead struct {
Expand Down Expand Up @@ -114,5 +115,13 @@ func (rxp *RxPortal) Rx(wm *WireMessage) (err error) {
return err
}

func (rxp *RxPortal) Close() {
if !rxp.closed {
rxp.reads <- &RxRead{nil, 0, true}
rxp.closed = true
close(rxp.rxs)
}
}

func (rxp *RxPortal) run() {
}

0 comments on commit 8572db4

Please sign in to comment.