MCPcopy
hub / github.com/nats-io/nats.go / BindSendChan

Method BindSendChan

netchan.go:28–35  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

26//
27// Deprecated: Encoded connections are no longer supported.
28func (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.

Callers 4

TestBadChanFunction · 0.80
TestSimpleSendChanFunction · 0.80
TestFailedChannelSendFunction · 0.80

Calls 1

chPublishFunction · 0.85

Tested by 4

TestBadChanFunction · 0.64
TestSimpleSendChanFunction · 0.64
TestFailedChannelSendFunction · 0.64