pooler.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Module pooler</title>
  5. <link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
  6. </head>
  7. <body bgcolor="white">
  8. <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>
  9. <hr>
  10. <h1>Module pooler</h1>
  11. <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>This is the main interface to the pooler application.
  12. <p>Copyright © 2011 Seth Falcon</p>
  13. <p><b>Behaviours:</b> <a href="gen_server.html"><tt>gen_server</tt></a>.</p>
  14. <p><b>Authors:</b> Seth Falcon (<a href="mailto:seth@userprimary.net"><tt>seth@userprimary.net</tt></a>).</p>
  15. <h2><a name="description">Description</a></h2><p>This is the main interface to the pooler application</p>
  16. To integrate with your application, you probably want to call
  17. application:start(pooler) after having specified appropriate
  18. configuration for the pooler application (either via a config file
  19. or appropriate calls to the application module to set the
  20. application's config).
  21. <h2><a name="index">Function Index</a></h2>
  22. <table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#code_change-3">code_change/3</a></td><td></td></tr>
  23. <tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td></td></tr>
  24. <tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td></td></tr>
  25. <tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td></td></tr>
  26. <tr><td valign="top"><a href="#init-1">init/1</a></td><td></td></tr>
  27. <tr><td valign="top"><a href="#pool_stats-0">pool_stats/0</a></td><td>Obtain runtime state info for all pools.</td></tr>
  28. <tr><td valign="top"><a href="#return_member-2">return_member/2</a></td><td>Return a member to the pool so it can be reused.</td></tr>
  29. <tr><td valign="top"><a href="#start-1">start/1</a></td><td></td></tr>
  30. <tr><td valign="top"><a href="#start_link-1">start_link/1</a></td><td></td></tr>
  31. <tr><td valign="top"><a href="#stop-0">stop/0</a></td><td></td></tr>
  32. <tr><td valign="top"><a href="#take_member-0">take_member/0</a></td><td>Obtain exclusive access to a member from a randomly selected pool.</td></tr>
  33. <tr><td valign="top"><a href="#terminate-2">terminate/2</a></td><td></td></tr>
  34. </table>
  35. <h2><a name="functions">Function Details</a></h2>
  36. <h3 class="function"><a name="code_change-3">code_change/3</a></h3>
  37. <div class="spec">
  38. <p><tt>code_change(OldVsn, State, Extra) -&gt; any()</tt></p>
  39. </div>
  40. <h3 class="function"><a name="handle_call-3">handle_call/3</a></h3>
  41. <div class="spec">
  42. <p><tt>handle_call(Request, From, State) -&gt; any()</tt></p>
  43. </div>
  44. <h3 class="function"><a name="handle_cast-2">handle_cast/2</a></h3>
  45. <div class="spec">
  46. <p><tt>handle_cast(Msg, State) -&gt; any()</tt></p>
  47. </div>
  48. <h3 class="function"><a name="handle_info-2">handle_info/2</a></h3>
  49. <div class="spec">
  50. <p><tt>handle_info(Info, State) -&gt; any()</tt></p>
  51. </div>
  52. <h3 class="function"><a name="init-1">init/1</a></h3>
  53. <div class="spec">
  54. <p><tt>init(Config) -&gt; any()</tt></p>
  55. </div>
  56. <h3 class="function"><a name="pool_stats-0">pool_stats/0</a></h3>
  57. <div class="spec">
  58. <p><tt>pool_stats() -&gt; any()</tt></p>
  59. </div><p><p>Obtain runtime state info for all pools.</p>
  60. Format of the return value is subject to change.</p>
  61. <h3 class="function"><a name="return_member-2">return_member/2</a></h3>
  62. <div class="spec">
  63. <p><tt>return_member(Pid, Status) -&gt; any()</tt></p>
  64. </div><p><p>Return a member to the pool so it can be reused.</p>
  65. If <code>Status</code> is 'ok', the member is returned to the pool. If
  66. <code>Status</code> is 'fail', the member is destroyed and a new member is
  67. added to the pool in its place.</p>
  68. <h3 class="function"><a name="start-1">start/1</a></h3>
  69. <div class="spec">
  70. <p><tt>start(Config) -&gt; any()</tt></p>
  71. </div>
  72. <h3 class="function"><a name="start_link-1">start_link/1</a></h3>
  73. <div class="spec">
  74. <p><tt>start_link(Config) -&gt; any()</tt></p>
  75. </div>
  76. <h3 class="function"><a name="stop-0">stop/0</a></h3>
  77. <div class="spec">
  78. <p><tt>stop() -&gt; any()</tt></p>
  79. </div>
  80. <h3 class="function"><a name="take_member-0">take_member/0</a></h3>
  81. <div class="spec">
  82. <p><tt>take_member() -&gt; any()</tt></p>
  83. </div><p><p>Obtain exclusive access to a member from a randomly selected pool.</p>
  84. If there are no free members in the randomly selected pool, then a
  85. member will be returned from the pool with the most free members.
  86. If no free members are available, 'error_no_members' is returned.
  87. </p>
  88. <h3 class="function"><a name="terminate-2">terminate/2</a></h3>
  89. <div class="spec">
  90. <p><tt>terminate(Reason, State) -&gt; any()</tt></p>
  91. </div>
  92. <hr>
  93. <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>
  94. <p><i>Generated by EDoc, Apr 17 2011, 16:02:59.</i></p>
  95. </body>
  96. </html>