-
Notifications
You must be signed in to change notification settings - Fork 1
Creating Jobs
to11mtm edited this page Nov 24, 2018
·
1 revision
#Guidelines for creating Jobs:
Jobs are pretty tolerant as far as parameters go.
- Polymorphism is best handled by having polymorphic types as generics on your parameter type.
//Example: Not as likely to work:
public class MyVeryPolymorphicParameterType
{
public object MyParameter {get;set;}
}
//Should work:
public class MyGenericPolymorphicParameterType<T>
{
public T MyParameter {get;set;
}
-
The parameters themselves may be part of a generic type argument on a class.
-
Any return value from the method is currently discarded; so while you aren't limited to a
void
call, you can't do anything with the result.- Instead, consider chaining one job to queue another, or use a Serialized Coordinator pattern.