tree: 99d8cf2d03d7587448bd8595c8cecf6f812e92cd [path history] [tgz]
  1. example_utils.py
  2. README.md
  3. requirements.txt
  4. run-example.py
  5. walkthrough.proto
  6. walkthrough.py
  7. walkthrough_pb2.py
statefun-examples/statefun-python-walkthrough-example/README.md

Apache Stateful Functions - Python SDK Walkthrough

Setup

  • Create a virtual env
python3 -m venv venv
source venv/bin/activate   
  • Install the requirements
pip3 install -r requirements.txt

If you are building from source, then first build the distribution (via calling statefun-python-sdk/build-distribution.sh) then copy statefun-python-sdk/dist/apache_flink_statefun-<version>-py3-none-any.whl here and run

pip3 install apache_flink_statefun-<version>-py3-none-any.whl

Examples

  • Checkout the walkthrough examples at walkthrough.py
  • To invoke one of the example functions, and observe its result, run:
python3 walkthrough.py

And from another terminal run:

python3 run-example.py <example name>

e.g.

python3 run-example.py walkthrough/hello