We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 265d222 commit afdb01dCopy full SHA for afdb01d
client.go
@@ -244,7 +244,7 @@ func (c *Client) Subscribe(topic string) <-chan Message {
244
}
245
246
// Publish publishes a message to the specified topic.
247
-func (c *Client) Publish(topic string, data []byte) error {
+func (c *Client) Publish(ctx context.Context, topic string, data []byte) error {
248
t, ok := c.topics[topic]
249
if !ok {
250
var err error
@@ -269,7 +269,7 @@ func (c *Client) Publish(topic string, data []byte) error {
269
return fmt.Errorf("failed to marshal message: %w", err)
270
271
272
- return t.Publish(c.ctx, msgBytes)
+ return t.Publish(ctx, msgBytes)
273
274
275
// GetPeers returns information about all known peers on subscribed topics.
0 commit comments