<div class="markdown_content"><hr />
<p><strong> <a class="alink" href="http://sourceforge.net/p/pure-data/patches/528">[patches:#528]</a> Ability to dispatch messages from running Pd patches to loaded tcl plugins</strong></p>
<p><strong>Status:</strong> open<br />
<strong>Group:</strong> feature<br />
<strong>Created:</strong> Sun Jul 13, 2014 09:41 PM UTC by Chris McCormick<br />
<strong>Last Updated:</strong> Sun Jul 13, 2014 09:41 PM UTC<br />
<strong>Owner:</strong> Miller Puckette</p>
<p>To test this patch out once applied, place the attached tcl plugin "test-dispatch-receiver-plugin.tcl" in ~/pd-externals/ and load the patch "test-plugin-dispatch-receiver.pd" in Pd.</p>
<hr />
<p>This patch lets a user send a message from a running Pd patch to a loaded tcl plugin. Plugins can register a receiver name to receive on with ::pd_connect::register_plugin_dispatch_receiver and patches can send to that receiver with a message to "pd plugin-dispatch RNAME" where RNAME is the name of the receiver registered by the tcl plugin.</p>
<p>Practical example: user could write an HTTP fetcher tcl plugin and have it receive on the name "http-fetch". A patch could then send a request to the plugin to fetch a web page using a Pd message like this:</p>
<p>[; pd plugin-dispatch http-fetch result_receiver_name <a href="http://mysite.com" rel="nofollow">http://mysite.com/</a>(</p>
<p>The plugin could go away and do the fetch, process what it gets back, and then send the result back to result_receiver_name when done.</p>
<p>Along with ::pd_connect::pdsend on the tcl side this gives a two-way interface from Pd patches to tcl plugins and back again.</p>
<p>This patch is also available on this git branch if you want to pull directly:<br />
<a href="https://github.com/chr15m/pure-data/commits/plugin-dispatch-messages" rel="nofollow">https://github.com/chr15m/pure-data/commits/plugin-dispatch-messages</a></p>
<hr />
<p>Sent from sourceforge.net because pd-dev@lists.iem.at is subscribed to <a href="https://sourceforge.net/p/pure-data/patches">https://sourceforge.net/p/pure-data/patches/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/pure-data/admin/patches/options.">https://sourceforge.net/p/pure-data/admin/patches/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>