acts channel client
Project description
acts-channel
Acts-channel is a workflow client to connect to acts-server
Usage
Before connecting, please download acts-server and start it
pip install acts-channel
Example
import signal
import sys
import time
from acts_channel import Channel
def signal_handler(signal, frame):
print('Caught Ctrl+C / SIGINT signal')
sys.exit(0)
def main():
chan = Channel(url = "127.0.0.1:10080")
signal.signal(signal.SIGINT, signal_handler)
model = """
id: test
name: workflow in python
steps:
- name: step 1
id: step1
acts:
- uses: acts.core.irq
key: abc
"""
resp = chan.deploy(model)
ret = resp.unwrap_or_raise(ValueError)
print("chan.deploy:", ret)
resp = chan.send("model:get", { "id": "test", "fmt": "tree"})
print(resp.ok_value["data"])
chan.subscribe("client-1", on_message)
resp = chan.start("test", { "custom": "aaa" })
print(resp.ok_value)
print("waiting for all messages...")
time.sleep(5)
def on_message(chan: Channel, message):
print(f"on_message: {message}")
if message["key"] == "abc":
chan.act("complete", message["pid"], message["tid"], {})
if __name__ == "__main__":
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
acts_channel-0.4.0.tar.gz
(7.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file acts_channel-0.4.0.tar.gz.
File metadata
- Download URL: acts_channel-0.4.0.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c2aa89858567693228c2d08c2d47569782a91bc8f7663ddcabe90b56c2c230d
|
|
| MD5 |
7afd48834464c689da153d1e3de320b3
|
|
| BLAKE2b-256 |
9b5412c94728c3e44b53e3021d185246fb3e435453047979e8340bbc8bc7f022
|
File details
Details for the file acts_channel-0.4.0-py3-none-any.whl.
File metadata
- Download URL: acts_channel-0.4.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96d00447566ff2850d5892a3f7b679e31f5778942dba95a83230fd720b8925a1
|
|
| MD5 |
176f3fa6254a645151bb0c4c80b935b7
|
|
| BLAKE2b-256 |
bbb3d10577bb4d6415f86d7cfa05ce7326f9d55ca72151fb2ab0ac52772ce695
|