include code to provide options for Web-Clients to request feedback f… #295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature Addition
Description
Currently there is no path for (Web) Clients to request direct feedback from a module. This PR enables clients to wait for a feedback from the module or a definable number of instances of this module.
This is achieved by introducing the
mmmrc_options
object into the payload.mmmrc_options
currently includes the following objects:wait
- set to true if this feature should be enabled (mandatory)responsecount
- number of feedbacks to wait for until feedback is returned (optional, default: 1)timeout
- amount of ms to wait for all feedbacks until timeout is generated (optional, default 1000ms)This module then sends a notification to the desired module's instances including the
mmrc_options
object from above, now adding a sub-objecttype=request
and a sub-objectid
The desired module responds with a sendNotification of type
MMMRC_RESPONSE
with a payload objectresponse
containing data to be transmitted and the objectmmmrc_options
now withtype=response
and the unchangedid
.Example code:
Once all feedbacks (see "responsecount" above) are collected or timeout has passed, this module returns data to the calling client.
Example return data:
Changelog
Requirements
none
Additional info
none, but feel free to ask :D