summaryrefslogtreecommitdiff
path: root/thread_utils.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2022-05-28 19:29:08 -0700
committerScott Gasch <[email protected]>2022-05-28 19:29:08 -0700
commit1e858172519e9339e4720b8bf9b39b6d9801e305 (patch)
tree75306d5a4eb3a9b512646f0acc5c6174644348a6 /thread_utils.py
parent52ff365609d3f5a81cb79dc4464b19bd5860cfc0 (diff)
Tweak around docstring to make prettier sphinx autodocs.
Diffstat (limited to 'thread_utils.py')
-rw-r--r--thread_utils.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/thread_utils.py b/thread_utils.py
index 01755de..5903782 100644
--- a/thread_utils.py
+++ b/thread_utils.py
@@ -72,7 +72,7 @@ def background_thread(
*** event as an input parameter and should periodically check ***
*** it and stop if the event is set. ***
- Usage:
+ Usage::
@background_thread
def random(a: int, b: str, stop_event: threading.Event) -> None:
@@ -82,7 +82,6 @@ def background_thread(
if stop_event.is_set():
return
-
def main() -> None:
(thread, event) = random(22, "dude")
print("back!")
@@ -131,13 +130,12 @@ def periodically_invoke(
Returns a Thread object and an Event that, when signaled, will stop
the invocations. Note that it is possible to be invoked one time
after the Event is set. This event can be used to stop infinite
- invocation style or finite invocation style decorations.
+ invocation style or finite invocation style decorations.::
@periodically_invoke(period_sec=0.5, stop_after=None)
def there(name: str, age: int) -> None:
print(f" ...there {name}, {age}")
-
@periodically_invoke(period_sec=1.0, stop_after=3)
def hello(name: str) -> None:
print(f"Hello, {name}")