-
Notifications
You must be signed in to change notification settings - Fork 6
Lifetime Methods
Roman edited this page Jan 11, 2023
·
2 revisions
There are a few methods available which can be used to setup and teardown things.
To register a global setup or teardown method which is just run once, just register one of the following method with your logic:
gotaskr.Setup(func() error {
...
})
// or
gotaskr.Teardown(func() error {
...
})
To add a method which does a setup and/or teardown before/after each task, register the one of the following methods:
gotaskr.TaskSetup(func() error {
...
})
// or
gotaskr.TaskTeardown(func() error {
...
})