You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this useful to control timeouts, cascade cancellation, and similar operations.
Also, as a final note, the context variable in Golang is normally expected to be the first parameter of the function, this is not a written rule but a very common and popular standard:
Following the standard patterns for storage and databases written in Golang, the context should be passed per operation and not per connection.
The current setup works in the following way:
and Get / Set / Delete / etc. operation are executed this way:
the expected call is the following:
and this is useful when we want to limit, for example, how long a Set or Get should takes before timing out:
this useful to control timeouts, cascade cancellation, and similar operations.
Also, as a final note, the context variable in Golang is normally expected to be the first parameter of the function, this is not a written rule but a very common and popular standard:
See https://golang.org/src/net/dial.go#L369 as an example.
The text was updated successfully, but these errors were encountered: