-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jobs RequestType discriminator seems to not work every #1686
Comments
Suggestion to fix:
|
JobType now is the assembly fully qualified name and it is actually used to get the correct Grain for an IJob based on the JobState because JobType has an implicit converter to Type. If we change it to Type.Name, the same as JobName, then we cannot do that anymore. How will the MongoDB Serializer for IJobRequest work? Doesn't it need to know about all the different implementations of IJobRequest? How will it know which CLR Type to convert the BSON document to? |
The lock in to the CLR type is actually the biggest problem with this. It would then potentially break a system from one version to another with Jobs being hydrated while upgrading if we change the namespace or name of the job. We would need to have something that holds a map of public interface IJobTypeManager
{
JobType GetJobTypeFor(Type type);
Type GetClrTypeFor(JobType type);
Type GetRequestClrTypeFor(JobType type);
} This could discover anything that implements But we could easily support overriding this, which would prove handy when renaming and wanting By introducing a [....]
public class JobTypeAttribute(string jobType); On a Job we would typically then add: [JobType]
public class CatchUpObserver
{
} |
Good idea. That makes sense |
And probably even better name for it would be |
Pr her #1693 however I'm having issues understanding how to implement the bson serializer |
We're getting exceptions like the following:
The text was updated successfully, but these errors were encountered: