package
Version:
v1.8.2-0...-f7776fc
Opens a new window with list of versions in this module.
Published: Feb 2, 2024
License: GPL-2.0, GPL-3.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package task provides primitives to track tasks via contexts.
ErrContext adds current task name to error on error return.
To work as intended it should be called under defer like this:
func myfunc(ctx, ...) (..., err error) {
ctx = task.Running("doing something")
defer task.ErrContext(&err, ctx)
...
Please see lab.nexedi.com/kirr/go123/xerr.Context for semantic details.
Running creates new task and returns new context with that task set to current.
Runningf is Running cousin with formatting support.
Task represents currently running operation.
Current returns current task represented by context.
if there is no current task - it returns nil.
String returns string representing whole operational stack.
For example if task "c" is running under task "b" which in turn is running
under task "a" - the operational stack will be "a: b: c".
nil Task is represented as "".
Source Files
¶
Click to show internal directories.
Click to hide internal directories.