diff --git a/awsimple/pubsub.py b/awsimple/pubsub.py index a60741a..a1f8972 100644 --- a/awsimple/pubsub.py +++ b/awsimple/pubsub.py @@ -273,7 +273,7 @@ def publish(self, message: dict) -> None: @typechecked() def get_messages(self) -> List[Dict[str, Any]]: """ - Get all available messages. Muse set sub_poll=True when creating the PubSub object to use this function. + Get all available messages. Use set sub_poll=True when creating the PubSub object to use this function. :return: list of messages as dictionaries """ diff --git a/doc/awsimple_pubsub_sf_python_1_26.pdf b/doc/awsimple_pubsub_sf_python_1_26.pdf new file mode 100644 index 0000000..bdd8f12 Binary files /dev/null and b/doc/awsimple_pubsub_sf_python_1_26.pdf differ diff --git a/doc/awsimple_pubsub_sf_python_1_26.pptx b/doc/awsimple_pubsub_sf_python_1_26.pptx new file mode 100644 index 0000000..eea5741 Binary files /dev/null and b/doc/awsimple_pubsub_sf_python_1_26.pptx differ diff --git a/doc/flake8_report.txt b/doc/flake8_report.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/make_venv.bat b/examples/make_venv.bat index ec581b5..428b6c3 100644 --- a/examples/make_venv.bat +++ b/examples/make_venv.bat @@ -1,5 +1,5 @@ rmdir /S /Q venv -c:"\Program Files\Python39\python.exe" -m venv --clear venv +c:"\Program Files\Python314\python.exe" -m venv --clear venv venv\Scripts\python.exe -m pip install --upgrade pip venv\Scripts\pip3 install -U setuptools venv\Scripts\pip3 install -U -r requirements-examples.txt diff --git a/examples/pubsub/pub_app.py b/examples/pubsub/pub_app.py new file mode 100644 index 0000000..7fd965a --- /dev/null +++ b/examples/pubsub/pub_app.py @@ -0,0 +1,7 @@ +from awsimple import Pub + +pub = Pub("awsimple_pubsub_example") +pub.start() +while input_message := input(f"Message to publish (or Enter to exit):").strip(): + pub.publish({"message": input_message}) +pub.request_exit() diff --git a/examples/pubsub/pubsub.bat b/examples/pubsub/pubsub.bat new file mode 100644 index 0000000..a936229 --- /dev/null +++ b/examples/pubsub/pubsub.bat @@ -0,0 +1,2 @@ +start "pub" ..\venv\Scripts\python.exe pub_app.py +start "sub" ..\venv\Scripts\python.exe sub_app.py \ No newline at end of file diff --git a/examples/pubsub/sub_app.py b/examples/pubsub/sub_app.py new file mode 100644 index 0000000..fc1dd57 --- /dev/null +++ b/examples/pubsub/sub_app.py @@ -0,0 +1,6 @@ +from awsimple import Sub + +sub = Sub("awsimple_pubsub_example", sub_callback=print) +sub.start() +input("Press Enter to exit...\n") +sub.request_exit()