-
Notifications
You must be signed in to change notification settings - Fork 9
Attribute Binding
Jef King edited this page Jun 27, 2018
·
4 revisions
Add the Task Finder Factory to your Role Task Manager, to emit tasks based on the attributes placed on your code. Note that the Configuration class below should be a class within the library that you have attribute based tasks in.
new RoleTaskManager<Configuration>(new TaskFinderFactory<Configuration>());
If you have code that you want to run once on load, this is the easiest way to get that code to fire once.
[Initialize]
public void Initialize()
{
}
This is a recurring task that will happen every X number of seconds.
[RunsEvery(10)]
public void Recurring()
{
}
This is for tasks which will change their frequency depending on if work was done. When work is consistent they will run at the fastest; if there is no work being done, they will gradually back off.
[RunsBetween(1, 500)]
public bool Dynamic()
{
return true;
}