Split activate_run_target into two methods - #621
Conversation
Forced activation will be implemented first, so splitting it makes it possible to just add the queue method later, rather than having certain combinations of arguments which cause an error. I think this will also make the usage more readable, as the behaviour is explained in the method name, rather than a boolean argument where you have to read the documentation to know what it does.
|
Maybe it would be better to just remove It is mostly the same as @NicolasFussberger What do you think? |
I think its a good idea. What do you think about this approach in general @SimonKozik? |
I'm not a big fan of just changing API, especially when it took some time to agree on. Which problem are we trying to solve here?
If we are trying to solve the first problem, then we should simply return If we are trying to solve the second problem, then we should understand that the queue is always there. I'm not sure what are we going to gain, by having a separate method to empty the queue. But if we want to go this way, then maybe following names could be the starting point for discusion: enqueue_run_target_activation(RunTargetName runTargetName);
force_run_target_activation(RunTargetName runTargetName);If we go this way, then I can see comments saying that @danth and @NicolasFussberger which problem are we trying to solve? |
Problem 1, to get #489 merged. I thought we could also solve problem 2 at the same time. But that is not the main goal.
I think it would be difficult for a new user to understand why all their calls are failing with this error. We would have to add a new error code for
The same problem exists in the current design, where you simply see a I suppose then that splitting into two methods is not much better than the current API, and we should just go with returning an error code to avoid making any unnecessary changes for now. |
No we only need to document (in know limitations) that currently the size of the queue is 1. We should remember that merging to main is not the same as releasing the product... And we should also remember that head of the main is not the supported product / release... People are not usually using the latest version from git, unless they know what they are doing and they need to do this. |
|
@danth reading your replay and mine again... I would say that the client side of the library should limit the number of requests to 1. This should be easily hacked with a static variable and should be good enough as temporary solution. Maybe a simple check on the |
Then I would be in favour of rather returning kNotImplemented error code when force=true. |
|
Sounds like I'll close this, and add the error code as part of #489 since it is only a few lines to change. |
Forced activation will be implemented first, so splitting it makes it possible to just add the queue method later, rather than having certain combinations of arguments which cause an error.
I think this will also make the usage more readable, as the behaviour is explained in the method name, rather than a boolean argument where you have to read the documentation to know what it does.