-
Notifications
You must be signed in to change notification settings - Fork 1
Fiber Management
Mike Puskar edited this page Dec 29, 2021
·
6 revisions
IPT.Common contains an abstract GenericFiber class that can be inherited to provide a simple interface to a long-running fiber. The fiber can be started and stopped, and the periodicity of the fiber is set upon instantiation.
using IPT.Common.API;
using IPT.Common.Fibers;
namespace IPT.TestPlugin.Fibers
{
internal class TestFiber : GenericFiber
{
public TestFiber()
: base("testfiber", 1000)
{
}
protected override void DoSomething()
{
Logging.Info("still here");
}
}
}
var fiber = TestFiber();
fiber.Start();
// will execute DoSomething() every second
fiber.Stop();