feat(Sharding*): contexts for broadcastEval (#5756)

* feat(ShardClientUtil): add parameterList to broadcastEval

* feat(ShardingManager): add parameterList to broadcastEval

* chore: update typings

* refactor(Sharding*): use BroadcastEvalOptions

* chore: update typings

* docs: use serializable instead of stringifiable

* refactor: don't set broadcastEval default context

Co-authored-by: Antonio Román <kyradiscord@gmail.com>

* chore: fix inaccuracy in typings

* refactor(Sharding*): remove string-based broadcastEval

* fix(ShardingManager): incorrect usage of _broadcastEvalRaw

* refactor(ShardingManager): remove unnecessary method

* refactor(Sharding*): type check the eval script

* fix(ShardingManager): return Promise rejection rather than throwing an error

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>

* chore: fix typings

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
Amish Shah
2021-06-09 18:14:33 +01:00
committed by GitHub
parent 7b2e12b102
commit c6aeebb18d
5 changed files with 34 additions and 18 deletions

View File

@@ -348,7 +348,7 @@ class Shard extends EventEmitter {
// Shard is requesting an eval broadcast
if (message._sEval) {
const resp = { _sEval: message._sEval, _sEvalShard: message._sEvalShard };
this.manager.broadcastEval(message._sEval, message._sEvalShard).then(
this.manager._performOnShards('eval', [message._sEval], message._sEvalShard).then(
results => this.send({ ...resp, _result: results }),
err => this.send({ ...resp, _error: Util.makePlainError(err) }),
);