/doc/core/z_dropbox.html

http://github.com/zotonic/zotonic · HTML · 81 lines · 68 code · 13 blank · 0 comment · 0 complexity · c3c5a96387c4af0e4c859efc7ff6975d MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Module z_dropbox</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 z_dropbox</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>Simple dropbox handler, monitors a directory and signals new files.
  12. <p>Copyright Š 2009 Marc Worrell
  13. </p>
  14. <p><b>Behaviours:</b> <a href="gen_server.html"><tt>gen_server</tt></a>.</p>
  15. <p><b>Authors:</b> Marc Worrell (<a href="mailto:marc@worrell.nl"><tt>marc@worrell.nl</tt></a>).</p>
  16. <h2><a name="description">Description</a></h2>Simple dropbox handler, monitors a directory and signals new files.
  17. <h2><a name="index">Function Index</a></h2>
  18. <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>Convert process state when code is changed.</td></tr>
  19. <tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td>Trap unknown calls.</td></tr>
  20. <tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td>Scan the dropbox, broadcast found files.</td></tr>
  21. <tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td>Handling all non call/cast messages.</td></tr>
  22. <tr><td valign="top"><a href="#init-1">init/1</a></td><td>Initiates the server.</td></tr>
  23. <tr><td valign="top"><a href="#scan-1">scan/1</a></td><td>Perform a scan of the dropbox, periodically called by a timer.</td></tr>
  24. <tr><td valign="top"><a href="#start_link-1">start_link/1</a></td><td>Starts the dropbox server.</td></tr>
  25. <tr><td valign="top"><a href="#terminate-2">terminate/2</a></td><td>This function is called by a gen_server when it is about to
  26. terminate.</td></tr>
  27. </table>
  28. <h2><a name="functions">Function Details</a></h2>
  29. <h3 class="function"><a name="code_change-3">code_change/3</a></h3>
  30. <div class="spec">
  31. <p><tt>code_change(OldVsn, State, Extra) -&gt; {ok, NewState}</tt></p>
  32. </div><p>Convert process state when code is changed</p>
  33. <h3 class="function"><a name="handle_call-3">handle_call/3</a></h3>
  34. <div class="spec">
  35. <p><tt>handle_call(Message::Request, From, State) -&gt; {reply, Reply, State} | {reply, Reply, State, Timeout} | {noreply, State} | {noreply, State, Timeout} | {stop, Reason, Reply, State} | {stop, Reason, State}</tt></p>
  36. </div><p>Trap unknown calls</p>
  37. <h3 class="function"><a name="handle_cast-2">handle_cast/2</a></h3>
  38. <div class="spec">
  39. <p><tt>handle_cast(Message::Msg, State) -&gt; {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}</tt></p>
  40. </div><p>Scan the dropbox, broadcast found files.</p>
  41. <h3 class="function"><a name="handle_info-2">handle_info/2</a></h3>
  42. <div class="spec">
  43. <p><tt>handle_info(Info, State) -&gt; {noreply, State} | {noreply, State, Timeout} | {stop, Reason, State}</tt></p>
  44. </div><p>Handling all non call/cast messages</p>
  45. <h3 class="function"><a name="init-1">init/1</a></h3>
  46. <div class="spec">
  47. <p><tt>init(SiteProps) -&gt; {ok, State} | {ok, State, Timeout} | ignore | {stop, Reason}</tt></p>
  48. </div><p>Initiates the server. Options are: dropbox_dir, processing_dir, unhandled_dir, interval, max_age and min_age</p>
  49. <h3 class="function"><a name="scan-1">scan/1</a></h3>
  50. <div class="spec">
  51. <p><tt>scan(Context::<a href="#type-context">context()</a>) -&gt; <a href="#type-void">void()</a></tt></p>
  52. </div><p>Perform a scan of the dropbox, periodically called by a timer.</p>
  53. <h3 class="function"><a name="start_link-1">start_link/1</a></h3>
  54. <div class="spec">
  55. <p><tt>start_link(SiteProps::SiteArgs) -&gt; {ok, Pid} | ignore | {error, Error}</tt></p>
  56. </div><p>Starts the dropbox server</p>
  57. <h3 class="function"><a name="terminate-2">terminate/2</a></h3>
  58. <div class="spec">
  59. <p><tt>terminate(Reason, State) -&gt; <a href="#type-void">void()</a></tt></p>
  60. </div><p>This function is called by a gen_server when it is about to
  61. terminate. It should be the opposite of Module:init/1 and do any necessary
  62. cleaning up. When it returns, the gen_server terminates with Reason.
  63. The return value is ignored.</p>
  64. <hr>
  65. <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>
  66. <p><i>Generated by EDoc, Oct 13 2011, 14:45:56.</i></p>
  67. </body>
  68. </html>