CBD.realtime.threadingPython.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>CBD.realtime.threadingPython module &mdash; CBD Simulation Development Kit documentation</title>
  8. <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  9. <!-- <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> -->
  10. <link rel="stylesheet" href="_static/style.css" type="text/css" />
  11. <link rel="index" title="Index" href="genindex.html" />
  12. <link rel="search" title="Search" href="search.html" />
  13. <link rel="next" title="CBD.realtime.threadingTkInter module" href="CBD.realtime.threadingTkInter.html" />
  14. <link rel="prev" title="CBD.realtime.threadingGameLoop module" href="CBD.realtime.threadingGameLoop.html" />
  15. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-167094275-1"></script>
  16. <script src="_static/js/googleanalytics.min.js"></script>
  17. <script src="_static/js/modernizr.min.js"></script>
  18. <!-- Preload the theme fonts -->
  19. <link rel="preload" href="_static/fonts/FreightSans/freight-sans-book.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  20. <link rel="preload" href="_static/fonts/FreightSans/freight-sans-medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  21. <link rel="preload" href="_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  22. <link rel="preload" href="_static/fonts/FreightSans/freight-sans-bold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  23. <link rel="preload" href="_static/fonts/FreightSans/freight-sans-medium-italic.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  24. <link rel="preload" href="_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  25. <!-- Preload the katex fonts -->
  26. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Math-Italic.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  27. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Main-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  28. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Main-Bold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  29. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size1-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  30. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size4-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  31. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size2-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  32. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size3-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  33. <link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Caligraphic-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
  34. </head>
  35. <div class="container-fluid header-holder tutorials-header" id="header-holder">
  36. <div class="container">
  37. <div class="header-container">
  38. <a class="header-logo" href="https://catalyst-team.com/" aria-label="Catalyst"></a>
  39. <div class="main-menu">
  40. <ul>
  41. <li>
  42. <div class="ecosystem-dropdown">
  43. <a id="dropdownMenuButtonEcosystem" data-toggle="ecosystem-dropdown">
  44. Ecosystem
  45. </a>
  46. <div class="ecosystem-dropdown-menu">
  47. <a class="nav-dropdown-item" href="https://alchemy.host">
  48. <span class=dropdown-title>Alchemy</span>
  49. <p>Experiments logging & visualization</p>
  50. </a>
  51. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/catalyst">
  52. <span class=dropdown-title>Catalyst</span>
  53. <p>Accelerated deep learning R&D</p>
  54. </a>
  55. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/reaction">
  56. <span class=dropdown-title>Reaction</span>
  57. <p>Convenient deep learning models serving</p>
  58. </a>
  59. </div>
  60. </div>
  61. </li>
  62. <li>
  63. <div class="projects-dropdown">
  64. <a id="dropdownMenuButtonProjects" data-toggle="projects-dropdown">
  65. Projects
  66. </a>
  67. <div class="projects-dropdown-menu">
  68. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/codestyle">
  69. <span class=dropdown-title>Codestyle</span>
  70. <p>Joint R&D codestyle</p>
  71. </a>
  72. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/neuro">
  73. <span class=dropdown-title>Catalyst.Neuro</span>
  74. <p>Catalyst.Team and TReNDS collaborative project</p>
  75. </a>
  76. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/classification">
  77. <span class=dropdown-title>Classification</span>
  78. <p>Image classification pipeline with transfer learning</p>
  79. </a>
  80. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/detection">
  81. <span class=dropdown-title>Detection</span>
  82. <p>Object detection pipeline</p>
  83. </a>
  84. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/segmentation">
  85. <span class=dropdown-title>Segmentation</span>
  86. <p>Image semantic segmentation pipeline</p>
  87. </a>
  88. <a class="nav-dropdown-item" href="https://github.com/catalyst-team/gan">
  89. <span class=dropdown-title>Catalyst.GAN</span>
  90. <p>GAN pipelines</p>
  91. </a>
  92. </div>
  93. </div>
  94. </li>
  95. <li>
  96. <a href="https://github.com/catalyst-team/dl-course">Deep learning course</a>
  97. </li>
  98. </ul>
  99. </div>
  100. <a class="main-menu-open-button" href="#" data-behavior="open-mobile-menu"></a>
  101. </div>
  102. </div>
  103. </div>
  104. <body class="catalyst-body">
  105. <div class="table-of-contents-link-wrapper">
  106. <span>Table of Contents</span>
  107. <a href="#" class="toggle-table-of-contents" data-behavior="toggle-table-of-contents"></a>
  108. </div>
  109. <nav data-toggle="wy-nav-shift" class="catalyst-left-menu" id="catalyst-left-menu">
  110. <div class="catalyst-side-scroll">
  111. <div class="catalyst-menu catalyst-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  112. <div class="catalyst-left-menu-search">
  113. <div role="search">
  114. <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
  115. <input type="text" name="q" placeholder="Search Docs" />
  116. <input type="hidden" name="check_keywords" value="yes" />
  117. <input type="hidden" name="area" value="default" />
  118. </form>
  119. </div>
  120. </div>
  121. <ul class="current">
  122. <li class="toctree-l1 current"><a class="reference internal" href="CBD.html">CBD package</a></li>
  123. </ul>
  124. </div>
  125. </div>
  126. </nav>
  127. <div class="catalyst-container">
  128. <div class="catalyst-page-level-bar" id="catalyst-page-level-bar">
  129. <div class="catalyst-breadcrumbs-wrapper">
  130. <div role="navigation" aria-label="breadcrumbs navigation">
  131. <ul class="catalyst-breadcrumbs">
  132. <li>
  133. <a href="index.html">
  134. Docs
  135. </a> &gt;
  136. </li>
  137. <li><a href="CBD.html">CBD package</a> &gt;</li>
  138. <li><a href="CBD.realtime.html">CBD.realtime package</a> &gt;</li>
  139. <li>CBD.realtime.threadingPython module</li>
  140. <li class="catalyst-breadcrumbs-aside">
  141. </li>
  142. </ul>
  143. </div>
  144. </div>
  145. <div class="catalyst-shortcuts-wrapper" id="catalyst-shortcuts-wrapper">
  146. Shortcuts
  147. </div>
  148. </div>
  149. <section data-toggle="wy-nav-shift" id="catalyst-content-wrap" class="catalyst-content-wrap">
  150. <div class="catalyst-content-left">
  151. <div class="rst-content">
  152. <div role="main" class="main-content" itemscope="itemscope" itemtype="http://schema.org/Article">
  153. <article itemprop="articleBody" id="catalyst-article" class="catalyst-article">
  154. <div class="section" id="module-CBD.realtime.threadingPython">
  155. <span id="cbd-realtime-threadingpython-module"></span><h1>CBD.realtime.threadingPython module<a class="headerlink" href="#module-CBD.realtime.threadingPython" title="Permalink to this headline">¶</a></h1>
  156. <dl class="class">
  157. <dt id="CBD.realtime.threadingPython.ThreadingPython">
  158. <em class="property">class </em><code class="descclassname">CBD.realtime.threadingPython.</code><code class="descname">ThreadingPython</code><a class="reference internal" href="_modules/CBD/realtime/threadingPython.html#ThreadingPython"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#CBD.realtime.threadingPython.ThreadingPython" title="Permalink to this definition">¶</a></dt>
  159. <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
  160. <p>Simple Python threads subsystem</p>
  161. <dl class="method">
  162. <dt id="CBD.realtime.threadingPython.ThreadingPython.wait">
  163. <code class="descname">wait</code><span class="sig-paren">(</span><em>delay</em>, <em>func</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/CBD/realtime/threadingPython.html#ThreadingPython.wait"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#CBD.realtime.threadingPython.ThreadingPython.wait" title="Permalink to this definition">¶</a></dt>
  164. <dd><p>Wait for the specified time, or faster if interrupted</p>
  165. <table class="docutils field-list" frame="void" rules="none">
  166. <col class="field-name" />
  167. <col class="field-body" />
  168. <tbody valign="top">
  169. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  170. <li><strong>delay</strong> – time to wait</li>
  171. <li><strong>func</strong> – the function to call</li>
  172. </ul>
  173. </td>
  174. </tr>
  175. </tbody>
  176. </table>
  177. </dd></dl>
  178. <dl class="method">
  179. <dt id="CBD.realtime.threadingPython.ThreadingPython.interrupt">
  180. <code class="descname">interrupt</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/CBD/realtime/threadingPython.html#ThreadingPython.interrupt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#CBD.realtime.threadingPython.ThreadingPython.interrupt" title="Permalink to this definition">¶</a></dt>
  181. <dd><p>Interrupt the waiting thread</p>
  182. </dd></dl>
  183. <dl class="method">
  184. <dt id="CBD.realtime.threadingPython.ThreadingPython.callFunc">
  185. <code class="descname">callFunc</code><span class="sig-paren">(</span><em>delay</em>, <em>func</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/CBD/realtime/threadingPython.html#ThreadingPython.callFunc"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#CBD.realtime.threadingPython.ThreadingPython.callFunc" title="Permalink to this definition">¶</a></dt>
  186. <dd><p>Function to call on a seperate thread: will block for the
  187. specified time and call the function afterwards</p>
  188. <table class="docutils field-list" frame="void" rules="none">
  189. <col class="field-name" />
  190. <col class="field-body" />
  191. <tbody valign="top">
  192. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
  193. <li><strong>delay</strong> (<em>float</em>) – The wait delay.</li>
  194. <li><strong>func</strong> – The function to call. No arguments can be
  195. used and no return values are needed.</li>
  196. </ul>
  197. </td>
  198. </tr>
  199. </tbody>
  200. </table>
  201. </dd></dl>
  202. </dd></dl>
  203. </div>
  204. </article>
  205. </div>
  206. <footer>
  207. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  208. <a href="CBD.realtime.threadingTkInter.html" class="btn btn-neutral float-right" title="CBD.realtime.threadingTkInter module" accesskey="n" rel="next">Next <img src="_static/images/chevron-right-orange.svg" class="next-page"></a>
  209. <a href="CBD.realtime.threadingGameLoop.html" class="btn btn-neutral" title="CBD.realtime.threadingGameLoop module" accesskey="p" rel="prev"><img src="_static/images/chevron-right-orange.svg" class="previous-page"> Previous</a>
  210. </div>
  211. <hr>
  212. <div role="contentinfo">
  213. <p>
  214. &copy; Copyright 2020, Randy Paredis.
  215. </p>
  216. </div>
  217. <div>
  218. Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
  219. </div>
  220. </footer>
  221. </div>
  222. </div>
  223. <div class="catalyst-content-right" id="catalyst-content-right">
  224. <div class="catalyst-right-menu" id="catalyst-right-menu">
  225. <div class="catalyst-side-scroll" id="catalyst-side-scroll-right">
  226. <ul>
  227. <li><a class="reference internal" href="#">CBD.realtime.threadingPython module</a></li>
  228. </ul>
  229. </div>
  230. </div>
  231. </div>
  232. </section>
  233. </div>
  234. <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
  235. <script type="text/javascript" src="_static/jquery.js"></script>
  236. <script type="text/javascript" src="_static/underscore.js"></script>
  237. <script type="text/javascript" src="_static/doctools.js"></script>
  238. <script type="text/javascript" src="_static/language_data.js"></script>
  239. <script type="text/javascript" src="_static/js/vendor/popper.min.js"></script>
  240. <script type="text/javascript" src="_static/js/vendor/bootstrap.min.js"></script>
  241. <script type="text/javascript" src="_static/js/theme.js"></script>
  242. <script type="text/javascript">
  243. jQuery(function () {
  244. SphinxRtdTheme.Navigation.enable(true);
  245. });
  246. </script>
  247. <!-- Begin Footer -->
  248. <footer class="site-footer" id="site-footer">
  249. <div class="container footer-container">
  250. <div class="footer-logo-wrapper">
  251. <a href="https://catalyst-team.com/" class="footer-logo"></a>
  252. </div>
  253. <div class="footer-links-wrapper">
  254. <div class="footer-links-col">
  255. <ul>
  256. <li class="list-title"><a href="https://github.com/catalyst-team">Ecosystem</a></li>
  257. <li><a class="nav-dropdown-item" href="https://alchemy.host">Alchemy</a></li>
  258. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/catalyst">Catalyst</a></li>
  259. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/reaction">Reaction</a></li>
  260. </ul>
  261. </div>
  262. <div class="footer-links-col">
  263. <ul>
  264. <li class="list-title"><a href="https://github.com/catalyst-team">Projects</a></li>
  265. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/codestyle">Codestyle</a></li>
  266. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/neuro">Catalyst.Neuro</a></li>
  267. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/classification">Classification</a></li>
  268. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/detection">Detection</a></li>
  269. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/segmentation">Segmentation</a></li>
  270. <li><a class="nav-dropdown-item" href="https://github.com/catalyst-team/gan">Catalyst.GAN</a></li>
  271. </ul>
  272. </div>
  273. <div class="footer-links-col">
  274. <ul>
  275. <li class="list-title"><a href="https://catalyst-team.com/">Support</a></li>
  276. <li><a href="https://github.com/catalyst-team/catalyst/issues" target="_blank">Github Issues</a></li>
  277. <li><a href="https://github.com/catalyst-team/catalyst/blob/master/CONTRIBUTING.md" target="_blank">Contributing</a></li>
  278. <li><a href="https://www.patreon.com/catalyst_team" target="_blank">Patreon</a></li>
  279. </ul>
  280. </div>
  281. <div class="footer-links-col follow-us-col">
  282. <div class="footer-social-icons">
  283. <a href="https://t.me/catalyst_team" target="_blank" class="telegram"></a>
  284. <a href="https://twitter.com/catalyst_core" target="_blank" class="twitter"></a>
  285. <a href="https://join.slack.com/t/catalyst-team-core/shared_invite/zt-d9miirnn-z86oKDzFMKlMG4fgFdZafw" target="_blank" class="ods"></a>
  286. </div>
  287. </div>
  288. </div>
  289. </div>
  290. </footer>
  291. <!-- End Footer -->
  292. <!-- Begin Mobile Menu -->
  293. <div class="mobile-main-menu">
  294. <div class="container-fluid">
  295. <div class="container">
  296. <div class="mobile-main-menu-header-container">
  297. <a class="header-logo" href="https://catalyst-team.com/" aria-label="Catalyst"></a>
  298. <a class="main-menu-close-button" href="#" data-behavior="close-mobile-menu"></a>
  299. </div>
  300. </div>
  301. </div>
  302. <div class="mobile-main-menu-links-container">
  303. <div class="main-menu">
  304. <ul>
  305. <li>
  306. <a href="">Get Started</a>
  307. </li>
  308. <li>
  309. <a href="https://github.com/catalyst-team/catalyst">Github</a>
  310. </li>
  311. </ul>
  312. </div>
  313. </div>
  314. </div>
  315. <!-- End Mobile Menu -->
  316. <script type="text/javascript" src="_static/js/vendor/anchor.min.js"></script>
  317. <script type="text/javascript">
  318. $(document).ready(function() {
  319. mobileMenu.bind();
  320. mobileTOC.bind();
  321. catalystAnchors.bind();
  322. sideMenus.bind();
  323. scrollToAnchor.bind();
  324. highlightNavigation.bind();
  325. mainMenuDropdown.bind();
  326. // Add class to links that have code blocks, since we cannot create links in code blocks
  327. $("article.catalyst-article a span.pre").each(function(e) {
  328. $(this).closest("a").addClass("has-code");
  329. });
  330. })
  331. </script>
  332. </body>
  333. </html>