mirror of
https://github.com/ubf/ubf.git
synced 2026-04-20 03:35:59 +00:00
101 lines
5.0 KiB
HTML
101 lines
5.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<title>Module ubf_plugin_handler</title>
|
|
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
|
|
</head>
|
|
<body bgcolor="white">
|
|
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
|
|
<hr>
|
|
|
|
<h1>Module ubf_plugin_handler</h1>
|
|
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>Implement the plugin server, an intermediate process between
|
|
the contract manager process and the server application.
|
|
|
|
|
|
<h2><a name="description">Description</a></h2><p>Implement the plugin server, an intermediate process between
|
|
the contract manager process and the server application.</p>
|
|
|
|
<p>The server application may or may not have a separate process (see
|
|
the diagram below). The there is no application process(es), then
|
|
the remote procedure call will be executed by the process executing
|
|
this module's <code>loop()</code> function.</p>
|
|
|
|
<p>This module also implements the plugin manager loop.
|
|
TODO More detail, please.</p>
|
|
|
|
<img src="../priv/doc/ubf-flow-01.png">
|
|
<h2><a name="index">Function Index</a></h2>
|
|
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#ask_manager-2">ask_manager/2</a></td><td></td></tr>
|
|
<tr><td valign="top"><a href="#install_default_handler-1">install_default_handler/1</a></td><td>Install a default handler function (callback-style) for
|
|
asynchronous UBF messages.</td></tr>
|
|
<tr><td valign="top"><a href="#install_handler-2">install_handler/2</a></td><td>Install a handler function (callback-style) for asynchronous
|
|
UBF messages.</td></tr>
|
|
<tr><td valign="top"><a href="#manager-3">manager/3</a></td><td></td></tr>
|
|
<tr><td valign="top"><a href="#sendEvent-2">sendEvent/2</a></td><td>Send an asynchronous UBF message.</td></tr>
|
|
<tr><td valign="top"><a href="#start_handler-5">start_handler/5</a></td><td></td></tr>
|
|
<tr><td valign="top"><a href="#start_manager-2">start_manager/2</a></td><td></td></tr>
|
|
</table>
|
|
|
|
<h2><a name="functions">Function Details</a></h2>
|
|
|
|
<h3 class="function"><a name="ask_manager-2">ask_manager/2</a></h3>
|
|
<div class="spec">
|
|
<p><tt>ask_manager(Manager, Q) -> any()</tt></p>
|
|
</div>
|
|
|
|
<h3 class="function"><a name="install_default_handler-1">install_default_handler/1</a></h3>
|
|
<div class="spec">
|
|
<p><tt>install_default_handler(Pid::pid()) -> ack</tt></p>
|
|
</div><p><p>Install a default handler function (callback-style) for
|
|
asynchronous UBF messages.</p>
|
|
|
|
The default handler function, drop_fun/1, does nothing.</p>
|
|
|
|
<h3 class="function"><a name="install_handler-2">install_handler/2</a></h3>
|
|
<div class="spec">
|
|
<p><tt>install_handler(Pid::pid(), Fun::function()) -> ack</tt></p>
|
|
</div><p><p>Install a handler function (callback-style) for asynchronous
|
|
UBF messages.</p>
|
|
|
|
<p>The handler fun Fun should be a function of arity 1. When an
|
|
asynchronous UBF message is received, the callback function will be
|
|
called with the UBF message as its single argument. The Fun is
|
|
called by the ubf plugin handler process so the Fun can crash
|
|
and/or block this process.</p>
|
|
|
|
If your handler fun must maintain its own state, then you must use
|
|
an intermediate anonymous fun to bind the state. See the usage of
|
|
the <tt>irc_client_gs:send_self/2</tt> fun as an example. The
|
|
<tt>send_self()</tt> fun is actually arity 2, but the extra
|
|
argument is how the author, Joe Armstrong, maintains the extra
|
|
state required to deliver the async UBF message to the process that
|
|
is executing the event loop processing function,
|
|
<tt>irc_client_gs:loop/6</tt>.</p>
|
|
|
|
<h3 class="function"><a name="manager-3">manager/3</a></h3>
|
|
<div class="spec">
|
|
<p><tt>manager(ExitPid, Mod, Args) -> any()</tt></p>
|
|
</div>
|
|
|
|
<h3 class="function"><a name="sendEvent-2">sendEvent/2</a></h3>
|
|
<div class="spec">
|
|
<p><tt>sendEvent(Pid::pid(), Msg) -> any()</tt></p>
|
|
</div><p>Send an asynchronous UBF message.</p>
|
|
|
|
<h3 class="function"><a name="start_handler-5">start_handler/5</a></h3>
|
|
<div class="spec">
|
|
<p><tt>start_handler(MetaMod, Mod, Server, StatelessRPC, SpawnOpts) -> any()</tt></p>
|
|
</div>
|
|
|
|
<h3 class="function"><a name="start_manager-2">start_manager/2</a></h3>
|
|
<div class="spec">
|
|
<p><tt>start_manager(Mod, Args) -> any()</tt></p>
|
|
</div>
|
|
<hr>
|
|
|
|
<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
|
|
<p><i>Generated EDoc, $Id$</i></p>
|
|
</body>
|
|
</html>
|