Documentation
¶
Index ¶
- func RunningLoop(ctx context.Context) bool
- func SnapshotMainForTests() (restore func())
- func With(ctx context.Context, c *Context) context.Context
- func WithRunningLoop(ctx context.Context) context.Context
- func WithoutRunningLoop(ctx context.Context) context.Context
- type Context
- type Item
- type Token
- type Var
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunningLoop ¶
Whether the context was marked as running an event loop
func SnapshotMainForTests ¶
func SnapshotMainForTests() (restore func())
Returns the restore of the main thread context to the values it holds now
func WithRunningLoop ¶
Marks a context as served by a goroutine running an event loop, asyncio.get_running_loop succeeding
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Mutable mapping of variables to values that one logical thread of execution runs inside
func CopyContext ¶
Copy of the current context like contextvars.copy_context
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
Restores a variable to what it held before one Set
type Var ¶
type Var struct {
// contains filtered or unexported fields
}
Variable whose value lives in a Context, read back as its default where the Context never set it