diff options
author | Monroe Linden <monroe@lindenlab.com> | 2010-04-23 15:50:22 -0700 |
---|---|---|
committer | Monroe Linden <monroe@lindenlab.com> | 2010-04-23 15:50:22 -0700 |
commit | 57a2a2beff565c9a2e2ed0937df178c38d114cb3 (patch) | |
tree | 02981ec90f7f0dd278fd35c4399180280b398b18 /indra/llplugin/llpluginmessage.cpp | |
parent | 13bf599e08d8ad3bba4facbc5fa9f468a1630dc7 (diff) |
Add a way for plugins to send a message and block waiting for the response
This requires some cooperation between the plugin and the host, and will only work for specific messages.
The way it works is as follows:
* the plugin sends a message containing the key "blocking_request" (with any value)
* this will cause the "send message" function to block (continuing to pull incoming messages off the network socket and queue them) until it receives a message from the host containing the key "blocking_response"
** NOTE: if the plugin sends a blocking_request that isn't set up to cause the host to send back a blocking_response, it will block forever
* the blocking_response message will be handed to the plugin's "receive message" function _immediately_ (before the "send message" function returns)
** this means that the plugin can extract response data for use by the the code that sent the message (but is still blocked inside the "send message" call)
** NOTE: this BREAKS the invariant stating that the plugin's "receive message" function will never be called recursively, and the plugin MUST be prepared to deal with this
* after the plugin finishes processing the blocking_response message, the "send message" function that was called with the blocking_request message will return to the plugin
* any queued messages will be delivered after the outer invocation of the plugin's "receive message" function returns (as normal)
Inside the viewer, the code can tell when a plugin is in this blocked state by calling LLPluginProcessParent::isBlocked(). LLPluginClassMedia uses this to avoid sending mouse-move and size-change messages to blocked plugins.
Diffstat (limited to 'indra/llplugin/llpluginmessage.cpp')
0 files changed, 0 insertions, 0 deletions