Examples using... context.Background()
Recent
CommandContext is like Command but includes a context.
Shutdown gracefully shuts down the server without interrupting any
active connections. Shutdown works by first closing all open
listeners, then closing all idle connections, and then waiting
indefinitely for connections to return to idle and then shut down.
If the provided context expires before the...
ConsumerGroup is responsible for dividing up processing of topics and partitions
over a collection of processes (the members of the consumer group).
Package sql provides a generic interface around SQL (or SQL-like)
databases.
Package sql provides a generic interface around SQL (or SQL-like)
databases.
This example demonstrates how a value can be passed to the context
and also how to retrieve it if it exists.
This example passes a context with a timeout to tell a blocking function that
it should abandon its work after the timeout elapses.
This example passes a context with an arbitrary deadline to tell a blocking
function that it should abandon its work as soon as it gets to it.
This example demonstrates the use of a cancelable context to prevent a
goroutine leak. By the end of the example function, the goroutine started
by gen will return without leaking.