Skip to main content

Framework for Asyncio/Actor/AHSM Run-to-completion Concurrency

Project description

farc

Framework for Asyncio/Actor/AHSM Run-to-completion Concurrency written in Python3. In other words, a cheap knock-off of QP that uses Python3 coroutines. This book describes QP and how to program statecharts(a.k.a. hierarchical state machines).

This framework has fewer than 1000 LOC. It allows the programmer to create highly-concurrent programs by using a message-passing system and run-to-completion message handlers within a state-machine architecture. With these tools, complex, asynchronous operations are decomposed into managable chunks of code.

Known Issue: On windows, Ctrl+C is supressed by asyncio event loop's run_forever() (bug report). The workaround is to inject an event to awake the event loop.

Note: This project used to be called "pq" but that name was taken in PyPI, so I renamed to farc (ugh).

Code Repository

https://github.com/dwhall/farc

Release History

2020/11/07 0.2.0

  • BREAKS API: Removed initEvent argument from Ahsm.start()
  • BREAKS API: Renamed camel-case procedures with underscores
  • BREAKS API: Eliminated @staticmethod and use of "me"
  • BREAKS API: Removed VcdSpy (debug helper) class from default namespace
  • Serialize Event values using pickle. This might lead to a runtime error for some.
  • call Framework.run() as soon as possible when an event is posted to AHSM (Max Peng).
  • Reimplement HSM algorithm and include hsm_test (Sze Tan)
  • Consolidated all files into __init__.py

2019/05/15 0.1.1

  • Removed 'initialState' argument from farc.Hsm() constructor; framework now expects Hsm/Ahsm classes to have 'initial()' method.
  • Made state methods private in examples to demonstrate a best-practice.
  • Created farc.Framework.run_forever() helper function.
  • Misc comment and doctring improvements

2018/10/09 0.1.0 Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

farc-0.2.0.tar.gz (12.9 kB view details)

Uploaded Source

File details

Details for the file farc-0.2.0.tar.gz.

File metadata

  • Download URL: farc-0.2.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for farc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c06df44472ddb97091161f9ffb5002928e4ec3a907f1accb5db0d136ffe4bfe7
MD5 28aaa0ba9a7f872f390a01fc36462827
BLAKE2b-256 c03be9cf986c8b3925b2ff41988aeb49ddaf5cbbda4f4105bcc169630f73072c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page