Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Request event fixed-length args. Fix #100.
- Change Blizzard `request.*` event handlers to be 2-arity. The remote argument list as an array is the first argument. The reply function is the second argument. - Update Yeti usage of these events to use the new signature. - Use the request argument list for incomingBridge events as their actual arguments, but without a reply function. `request.*` events for Blizzard handle remote RPC requests. Sometimes the event will reply to the caller's side using a reply function provided as the last argument. A malformed RPC request with too many or too few arguments caused the event handler to expect the reply function in the wrong place in the argument list, yielding a crash. To maintain compatibility with the majority of Yeti events which use the incomingBridge API to bridge an EventEmitter event to a Blizzard `request` event handler, the remote argument list (first argument) is unpacked and the bridged event is fired with that argument list. The reply function is not included. The incomingBridge API is only intended for make a remote event appear local -- not to handle RPC-specific behavior like a reply. Yeti already follows this rule, so no further changes are needed.
- Loading branch information
Showing
5 changed files
with
60 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters