github.com/godevsig/adaptiveservice@v0.9.23/client_options.go (about) 1 package adaptiveservice 2 3 // SetDiscoverTimeout sets the wait timeout in seconds of the discover procedure. 4 // The discover procedure waits for the wanted service to be available until timeout. 5 // The connection channel returned by Discover() will be closed if timeout happens. 6 // > 0 : wait timeout seconds 7 // = 0 : do not wait 8 // < 0 : wait forever 9 // Default -1. 10 func (c *Client) SetDiscoverTimeout(timeout int) *Client { 11 c.discoverTimeout = timeout 12 return c 13 } 14 15 // SetDeepCopy sets the client to deep copy the message before sending it out. 16 // This option is only useful for process scope where by default the server 17 // can modify the message that the client owns because server and client in 18 // the same process space, and this case only happens when the message handler 19 // in the server has reference receiver. 20 // 21 // Unexported fields in the message are not copied but set to zero value. 22 // Default is zero copy. 23 func (c *Client) SetDeepCopy() *Client { 24 c.deepCopy = true 25 return c 26 }