This allows the functionality for network channels by binding send and receive Go chans to subjects and optionally queue groups. Data will be encoded and decoded via the EncodedConn and its associated encoders. BindSendChan binds a channel for send operations to NATS. Deprecated: Encoded connection
(subject string, channel any)
| 26 | // |
| 27 | // Deprecated: Encoded connections are no longer supported. |
| 28 | func (c *EncodedConn) BindSendChan(subject string, channel any) error { |
| 29 | chVal := reflect.ValueOf(channel) |
| 30 | if chVal.Kind() != reflect.Chan { |
| 31 | return ErrChanArg |
| 32 | } |
| 33 | go chPublish(c, chVal, subject) |
| 34 | return nil |
| 35 | } |
| 36 | |
| 37 | // Publish all values that arrive on the channel until it is closed or we |
| 38 | // encounter an error. |