add: scheduler config option for cluster#42308
Conversation
286733a to
645b540
Compare
cbe6731 to
21d893d
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
21d893d to
581a209
Compare
This comment was marked as outdated.
This comment was marked as outdated.
581a209 to
87bc466
Compare
This comment was marked as outdated.
This comment was marked as outdated.
87bc466 to
9dec344
Compare
This comment was marked as outdated.
This comment was marked as outdated.
9dec344 to
e3980ff
Compare
|
Opening this for initial review. Will add the docs later after the finalisation. |
e3980ff to
40302e5
Compare
| function validateAndReturnScheduler(scheduler, schedulingPolicy) { | ||
| if (scheduler !== undefined) { | ||
| if (typeof scheduler.execute !== 'function') { | ||
| throw new ERR_CLUSTER_INVALID_SCHEDULER('scheduler.execute'); |
There was a problem hiding this comment.
Not sure this warrants a new error code. ERR_INVALID_ARG_TYPE would probably still work here.
There was a problem hiding this comment.
INVALID_ARG_TYPE seems very broad and that's why i made the choice of ERR_CLUSTER_INVALID_SCHEDULER. Will update the use to INVALID_ARG_TYPE.
40302e5 to
8328c98
Compare
|
It's nice to see this picked back up. Just a word of caution @yashLadha - I don't know how popular |
|
@cjihrig Sure, reason why i wanted this being i also faced similar issue at one the projects and though if this is part of core cluster then that would be awesome. |
scheduler let's use a custom scheduler function for scheduling workers.
8328c98 to
5cbeb35
Compare
This is a WIP PR for adding custom scheduler to cluster.
Will add the doc changes later after the finalisation of structure in PR.