diff options
Diffstat (limited to 'client/messages.html')
| -rw-r--r-- | client/messages.html | 349 |
1 files changed, 349 insertions, 0 deletions
diff --git a/client/messages.html b/client/messages.html new file mode 100644 index 0000000..4b9647f --- /dev/null +++ b/client/messages.html | |||
| @@ -0,0 +1,349 @@ | |||
| 1 | |||
| 2 | |||
| 3 | <!DOCTYPE html> | ||
| 4 | <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> | ||
| 5 | <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> | ||
| 6 | <head> | ||
| 7 | <meta charset="utf-8"> | ||
| 8 | |||
| 9 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| 10 | |||
| 11 | <title>messages – Client Messaging — EventMQ 0 documentation</title> | ||
| 12 | |||
| 13 | |||
| 14 | |||
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | |||
| 25 | |||
| 26 | |||
| 27 | <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> | ||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | <link rel="top" title="EventMQ 0 documentation" href="../index.html"/> | ||
| 34 | <link rel="up" title="client – Client Utilities" href="../client.html"/> | ||
| 35 | <link rel="next" title="exceptions – Exceptions" href="../exceptions.html"/> | ||
| 36 | <link rel="prev" title="client – Client Utilities" href="../client.html"/> | ||
| 37 | |||
| 38 | |||
| 39 | <script src="../_static/js/modernizr.min.js"></script> | ||
| 40 | |||
| 41 | </head> | ||
| 42 | |||
| 43 | <body class="wy-body-for-nav" role="document"> | ||
| 44 | |||
| 45 | <div class="wy-grid-for-nav"> | ||
| 46 | |||
| 47 | |||
| 48 | <nav data-toggle="wy-nav-shift" class="wy-nav-side"> | ||
| 49 | <div class="wy-side-scroll"> | ||
| 50 | <div class="wy-side-nav-search"> | ||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | <a href="../index.html" class="icon icon-home"> EventMQ | ||
| 55 | |||
| 56 | |||
| 57 | |||
| 58 | </a> | ||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | |||
| 63 | <div class="version"> | ||
| 64 | 0 | ||
| 65 | </div> | ||
| 66 | |||
| 67 | |||
| 68 | |||
| 69 | |||
| 70 | <div role="search"> | ||
| 71 | <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> | ||
| 72 | <input type="text" name="q" placeholder="Search docs" /> | ||
| 73 | <input type="hidden" name="check_keywords" value="yes" /> | ||
| 74 | <input type="hidden" name="area" value="default" /> | ||
| 75 | </form> | ||
| 76 | </div> | ||
| 77 | |||
| 78 | |||
| 79 | </div> | ||
| 80 | |||
| 81 | <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> | ||
| 82 | |||
| 83 | |||
| 84 | |||
| 85 | <ul class="current"> | ||
| 86 | <li class="toctree-l1 current"><a class="reference internal" href="../api.html">API Documentation</a><ul class="current"> | ||
| 87 | <li class="toctree-l2 current"><a class="reference internal" href="../client.html"><code class="docutils literal"><span class="pre">client</span></code> – Client Utilities</a><ul class="current"> | ||
| 88 | <li class="toctree-l3 current"><a class="current reference internal" href=""><code class="docutils literal"><span class="pre">messages</span></code> – Client Messaging</a></li> | ||
| 89 | </ul> | ||
| 90 | </li> | ||
| 91 | <li class="toctree-l2"><a class="reference internal" href="../exceptions.html"><code class="docutils literal"><span class="pre">exceptions</span></code> – Exceptions</a></li> | ||
| 92 | <li class="toctree-l2"><a class="reference internal" href="../jobmanager.html"><code class="docutils literal"><span class="pre">jobmanager</span></code> – Job Manager</a></li> | ||
| 93 | <li class="toctree-l2"><a class="reference internal" href="../poller.html"><code class="docutils literal"><span class="pre">poller</span></code> – Poller</a></li> | ||
| 94 | <li class="toctree-l2"><a class="reference internal" href="../receiver.html"><code class="docutils literal"><span class="pre">receiver</span></code> – Receiver</a></li> | ||
| 95 | <li class="toctree-l2"><a class="reference internal" href="../router.html"><code class="docutils literal"><span class="pre">router</span></code> – Router</a></li> | ||
| 96 | <li class="toctree-l2"><a class="reference internal" href="../sender.html"><code class="docutils literal"><span class="pre">sender</span></code> – Sender</a></li> | ||
| 97 | <li class="toctree-l2"><a class="reference internal" href="../utils.html"><code class="docutils literal"><span class="pre">utils</span></code> – Utilities</a></li> | ||
| 98 | </ul> | ||
| 99 | </li> | ||
| 100 | <li class="toctree-l1"><a class="reference internal" href="../contributing.html">Contributing to EventMQ</a></li> | ||
| 101 | </ul> | ||
| 102 | |||
| 103 | |||
| 104 | |||
| 105 | </div> | ||
| 106 | </div> | ||
| 107 | </nav> | ||
| 108 | |||
| 109 | <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> | ||
| 110 | |||
| 111 | |||
| 112 | <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> | ||
| 113 | <i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
| 114 | <a href="../index.html">EventMQ</a> | ||
| 115 | </nav> | ||
| 116 | |||
| 117 | |||
| 118 | |||
| 119 | <div class="wy-nav-content"> | ||
| 120 | <div class="rst-content"> | ||
| 121 | |||
| 122 | |||
| 123 | |||
| 124 | |||
| 125 | |||
| 126 | |||
| 127 | <div role="navigation" aria-label="breadcrumbs navigation"> | ||
| 128 | <ul class="wy-breadcrumbs"> | ||
| 129 | <li><a href="../index.html">Docs</a> »</li> | ||
| 130 | |||
| 131 | <li><a href="../api.html">API Documentation</a> »</li> | ||
| 132 | |||
| 133 | <li><a href="../client.html"><code class="docutils literal"><span class="pre">client</span></code> – Client Utilities</a> »</li> | ||
| 134 | |||
| 135 | <li><code class="docutils literal"><span class="pre">messages</span></code> – Client Messaging</li> | ||
| 136 | <li class="wy-breadcrumbs-aside"> | ||
| 137 | |||
| 138 | |||
| 139 | <a href="../_sources/client/messages.txt" rel="nofollow"> View page source</a> | ||
| 140 | |||
| 141 | |||
| 142 | </li> | ||
| 143 | </ul> | ||
| 144 | <hr/> | ||
| 145 | </div> | ||
| 146 | <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
| 147 | <div itemprop="articleBody"> | ||
| 148 | |||
| 149 | <span class="target" id="module-eventmq.client.messages"></span><div class="section" id="messages-client-messaging"> | ||
| 150 | <h1><code class="xref py py-mod docutils literal"><span class="pre">messages</span></code> – Client Messaging<a class="headerlink" href="#messages-client-messaging" title="Permalink to this headline">¶</a></h1> | ||
| 151 | <dl class="function"> | ||
| 152 | <dt id="eventmq.client.messages.build_module_path"> | ||
| 153 | <code class="descclassname">eventmq.client.messages.</code><code class="descname">build_module_path</code><span class="sig-paren">(</span><em>func</em><span class="sig-paren">)</span><a class="headerlink" href="#eventmq.client.messages.build_module_path" title="Permalink to this definition">¶</a></dt> | ||
| 154 | <dd><p>Builds the module path in string format for a callable.</p> | ||
| 155 | <table class="docutils field-list" frame="void" rules="none"> | ||
| 156 | <col class="field-name" /> | ||
| 157 | <col class="field-body" /> | ||
| 158 | <tbody valign="top"> | ||
| 159 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>func</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#callable" title="(in Python v2.7)"><em>callable</em></a>) – The function or method to build the path for</td> | ||
| 160 | </tr> | ||
| 161 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">(import path (w/ class seperated by a ‘:’), callable name) or | ||
| 162 | (None, None) on error</td> | ||
| 163 | </tr> | ||
| 164 | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/library/functions.html#list" title="(in Python v2.7)">list</a></td> | ||
| 165 | </tr> | ||
| 166 | </tbody> | ||
| 167 | </table> | ||
| 168 | </dd></dl> | ||
| 169 | |||
| 170 | <dl class="function"> | ||
| 171 | <dt id="eventmq.client.messages.defer_job"> | ||
| 172 | <code class="descclassname">eventmq.client.messages.</code><code class="descname">defer_job</code><span class="sig-paren">(</span><em>socket</em>, <em>func</em>, <em>args=()</em>, <em>kwargs=None</em>, <em>class_args=()</em>, <em>class_kwargs=None</em>, <em>reply_requested=False</em>, <em>guarantee=False</em>, <em>retry_count=0</em>, <em>queue='default'</em><span class="sig-paren">)</span><a class="headerlink" href="#eventmq.client.messages.defer_job" title="Permalink to this definition">¶</a></dt> | ||
| 173 | <dd><p>Used to send a job to a worker to execute via <cite>socket</cite>.</p> | ||
| 174 | <p>This tries not to raise any exceptions so use some of the message flags to | ||
| 175 | guarentee things.</p> | ||
| 176 | <table class="docutils field-list" frame="void" rules="none"> | ||
| 177 | <col class="field-name" /> | ||
| 178 | <col class="field-body" /> | ||
| 179 | <tbody valign="top"> | ||
| 180 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | ||
| 181 | <li><strong>socket</strong> (<a class="reference external" href="https://docs.python.org/library/socket.html#module-socket" title="(in Python v2.7)"><em>socket</em></a>) – eventmq socket to use for sending the message</li> | ||
| 182 | <li><strong>func</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#callable" title="(in Python v2.7)"><em>callable</em></a>) – the callable to be deferred to a worker</li> | ||
| 183 | <li><strong>args</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#list" title="(in Python v2.7)"><em>list</em></a>) – list of <a href="#id1"><span class="problematic" id="id2">*</span></a>args for the callable</li> | ||
| 184 | <li><strong>kwargs</strong> (<a class="reference external" href="https://docs.python.org/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) – dict of <a href="#id3"><span class="problematic" id="id4">**</span></a>kwargs for the callable</li> | ||
| 185 | <li><strong>class_args</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#list" title="(in Python v2.7)"><em>list</em></a>) – list of <a href="#id5"><span class="problematic" id="id6">*</span></a>args to pass to the the class when | ||
| 186 | initializing (if applicable).</li> | ||
| 187 | <li><strong>class_kwargs</strong> (<a class="reference external" href="https://docs.python.org/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) – dict of <a href="#id7"><span class="problematic" id="id8">**</span></a>kwargs to pass to the class when | ||
| 188 | initializing (if applicable).</li> | ||
| 189 | <li><strong>reply_requested</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) – request the return value of func as a reply</li> | ||
| 190 | <li><strong>guarantee</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) – (Give your best effort) to guarantee that func is | ||
| 191 | executed. Exceptions and things will be logged.</li> | ||
| 192 | <li><strong>retry_count</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a>) – How many times should be retried when encountering | ||
| 193 | an Exception or some other failure before giving up. (default: 0 | ||
| 194 | or immediatly fail)</li> | ||
| 195 | <li><strong>queue</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – Name of queue to use when executing the job. Default: is | ||
| 196 | configured default queue name</li> | ||
| 197 | </ul> | ||
| 198 | </td> | ||
| 199 | </tr> | ||
| 200 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">True if the message was successfully queued, False if something | ||
| 201 | went wrong. If something did go wrong check the logs for details.</p> | ||
| 202 | </td> | ||
| 203 | </tr> | ||
| 204 | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><a class="reference external" href="https://docs.python.org/library/functions.html#bool" title="(in Python v2.7)">bool</a></p> | ||
| 205 | </td> | ||
| 206 | </tr> | ||
| 207 | </tbody> | ||
| 208 | </table> | ||
| 209 | </dd></dl> | ||
| 210 | |||
| 211 | <dl class="function"> | ||
| 212 | <dt id="eventmq.client.messages.job"> | ||
| 213 | <code class="descclassname">eventmq.client.messages.</code><code class="descname">job</code><span class="sig-paren">(</span><em>block=False</em><span class="sig-paren">)</span><a class="headerlink" href="#eventmq.client.messages.job" title="Permalink to this definition">¶</a></dt> | ||
| 214 | <dd><p>run the decorated function on a worker</p> | ||
| 215 | <table class="docutils field-list" frame="void" rules="none"> | ||
| 216 | <col class="field-name" /> | ||
| 217 | <col class="field-body" /> | ||
| 218 | <tbody valign="top"> | ||
| 219 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>block</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) – Set to True if you wish to block and wait for the | ||
| 220 | response. This may be useful for running quick but cpu intesive | ||
| 221 | that would otherwise overwhelm a box that has to do it all alone. | ||
| 222 | (decryption?)</td> | ||
| 223 | </tr> | ||
| 224 | </tbody> | ||
| 225 | </table> | ||
| 226 | </dd></dl> | ||
| 227 | |||
| 228 | <dl class="function"> | ||
| 229 | <dt id="eventmq.client.messages.send_request"> | ||
| 230 | <code class="descclassname">eventmq.client.messages.</code><code class="descname">send_request</code><span class="sig-paren">(</span><em>socket</em>, <em>message</em>, <em>reply_requested=False</em>, <em>guarantee=False</em>, <em>retry_count=0</em>, <em>queue=None</em><span class="sig-paren">)</span><a class="headerlink" href="#eventmq.client.messages.send_request" title="Permalink to this definition">¶</a></dt> | ||
| 231 | <dd><p>Send a REQUEST command.</p> | ||
| 232 | <p>Default headers are always all disabled by default. If they are included in | ||
| 233 | the headers then they have been enabled.</p> | ||
| 234 | <p>To execute a task, the message should be formatted as follows: | ||
| 235 | {subcommand(str), {</p> | ||
| 236 | <blockquote> | ||
| 237 | <div><p># dot path location where callable can be imported. If callable is a | ||
| 238 | # method on a class, the class should always come last, and be | ||
| 239 | # seperated with a colon. (So we know to instantiate on the receiving | ||
| 240 | # end) | ||
| 241 | ‘path’: path(str), | ||
| 242 | # function or method name to run | ||
| 243 | ‘callable’: callable(str), | ||
| 244 | # Optional args for callable | ||
| 245 | ‘args’: (arg, arg), | ||
| 246 | # Optional kwargs for callable | ||
| 247 | ‘kwargs’: {‘kwarg’: kwarg}, | ||
| 248 | # Optional class args, kwargs | ||
| 249 | ‘class_args’: (arg2, arg3), | ||
| 250 | ‘class_kwargs’: {‘kwarg2’: kwarg}</p> | ||
| 251 | <p>}</p> | ||
| 252 | </div></blockquote> | ||
| 253 | <p>} | ||
| 254 | :param socket: Socket to use when sending <cite>message</cite> | ||
| 255 | :type socket: socket | ||
| 256 | :param message: message to send to <cite>socket</cite> | ||
| 257 | :param reply_requested: request the return value of func as a reply | ||
| 258 | :type reply_requested: bool | ||
| 259 | :param guarantee: (Give your best effort) to guarantee that func is</p> | ||
| 260 | <blockquote> | ||
| 261 | <div>executed. Exceptions and things will be logged.</div></blockquote> | ||
| 262 | <table class="docutils field-list" frame="void" rules="none"> | ||
| 263 | <col class="field-name" /> | ||
| 264 | <col class="field-body" /> | ||
| 265 | <tbody valign="top"> | ||
| 266 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple"> | ||
| 267 | <li><strong>retry_count</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a>) – How many times should be retried when encountering | ||
| 268 | an Exception or some other failure before giving up. (default: 0 | ||
| 269 | or immediatly fail)</li> | ||
| 270 | <li><strong>queue</strong> (<a class="reference external" href="https://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) – Name of queue to use when executing the job. Default: is | ||
| 271 | configured default queue name</li> | ||
| 272 | </ul> | ||
| 273 | </td> | ||
| 274 | </tr> | ||
| 275 | </tbody> | ||
| 276 | </table> | ||
| 277 | </dd></dl> | ||
| 278 | |||
| 279 | </div> | ||
| 280 | |||
| 281 | |||
| 282 | </div> | ||
| 283 | </div> | ||
| 284 | <footer> | ||
| 285 | |||
| 286 | <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> | ||
| 287 | |||
| 288 | <a href="../exceptions.html" class="btn btn-neutral float-right" title="exceptions – Exceptions" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a> | ||
| 289 | |||
| 290 | |||
| 291 | <a href="../client.html" class="btn btn-neutral" title="client – Client Utilities" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a> | ||
| 292 | |||
| 293 | </div> | ||
| 294 | |||
| 295 | |||
| 296 | <hr/> | ||
| 297 | |||
| 298 | <div role="contentinfo"> | ||
| 299 | <p> | ||
| 300 | © Copyright 2015, eventboard.io. | ||
| 301 | |||
| 302 | </p> | ||
| 303 | </div> | ||
| 304 | Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
| 305 | |||
| 306 | </footer> | ||
| 307 | |||
| 308 | </div> | ||
| 309 | </div> | ||
| 310 | |||
| 311 | </section> | ||
| 312 | |||
| 313 | </div> | ||
| 314 | |||
| 315 | |||
| 316 | |||
| 317 | |||
| 318 | |||
| 319 | <script type="text/javascript"> | ||
| 320 | var DOCUMENTATION_OPTIONS = { | ||
| 321 | URL_ROOT:'../', | ||
| 322 | VERSION:'0', | ||
| 323 | COLLAPSE_INDEX:false, | ||
| 324 | FILE_SUFFIX:'.html', | ||
| 325 | HAS_SOURCE: true | ||
| 326 | }; | ||
| 327 | </script> | ||
| 328 | <script type="text/javascript" src="../_static/jquery.js"></script> | ||
| 329 | <script type="text/javascript" src="../_static/underscore.js"></script> | ||
| 330 | <script type="text/javascript" src="../_static/doctools.js"></script> | ||
| 331 | |||
| 332 | |||
| 333 | |||
| 334 | |||
| 335 | |||
| 336 | <script type="text/javascript" src="../_static/js/theme.js"></script> | ||
| 337 | |||
| 338 | |||
| 339 | |||
| 340 | |||
| 341 | <script type="text/javascript"> | ||
| 342 | jQuery(function () { | ||
| 343 | SphinxRtdTheme.StickyNav.enable(); | ||
| 344 | }); | ||
| 345 | </script> | ||
| 346 | |||
| 347 | |||
| 348 | </body> | ||
| 349 | </html> \ No newline at end of file | ||