Skip to content
Snippets Groups Projects
Commit 9e58bccb authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Add function to get messaging contexts with custom timeouts.

parent 3b73a40e
No related branches found
No related tags found
2 merge requests!18Release,!15Add function to get messaging contexts with custom timeouts.
...@@ -139,7 +139,13 @@ func (h *Host) Connected() (bool, uint64) { ...@@ -139,7 +139,13 @@ func (h *Host) Connected() (bool, uint64) {
// GetMessagingContext returns a context object for message sending configured according to HostParams // GetMessagingContext returns a context object for message sending configured according to HostParams
func (h *Host) GetMessagingContext() (context.Context, context.CancelFunc) { func (h *Host) GetMessagingContext() (context.Context, context.CancelFunc) {
return newContext(h.params.SendTimeout) return h.GetMessagingContextWithTimeout(h.params.SendTimeout)
}
// GetMessagingContext returns a context object for message sending configured according to HostParams
func (h *Host) GetMessagingContextWithTimeout(
timeout time.Duration) (context.Context, context.CancelFunc) {
return newContext(timeout)
} }
// GetId returns the id of the host // GetId returns the id of the host
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment