Skip to main content

haps-runtime-executor

Execution daemon for HAPS runtimes: it watches a runtime, picks up the pending jobs and runs each one in its own thread. You only write what a job does.

Built on haps-runtime.

Install

pip install haps-runtime-executor

Requires Python 3.11 or newer.

Quick start

from haps_runtime import HapsClient
from haps_runtime_executor import RuntimeJob, RuntimeJobError, RuntimeService


class EchoJob(RuntimeJob):
    def execute(self) -> None:
        if not self.job.arguments:
            raise RuntimeJobError("no argument given")  # the job ends FAILED

    def voutput(self, index: int, name: str) -> str:
        return self.job.arguments[0]


client = HapsClient(
    ebservice_url="https://ebservice.example.org/api/v1",
    ebuffer_url="https://ebuffer.example.org/api/v1",
    username="maintainer",
    password="secret",
)
runtime = client.runtimes.find(accepted_mime_type="application/x-echo")[0]

service = RuntimeService(runtime, EchoJob, polltime=5)
service.start()
service.join()

Hooks

Override what your job needs, all optional:

Hook Called
vinput(index, name, value) for each scalar argument
ebinput(index, name, buffer_uuid) for each input buffer
execute() once, to do the work
voutput(index, name) for each result, returns its value
eboutput(index, name, buffer_uuid) for each output buffer
on_stop() when the job is stopped or cancelled
cleanup() always, at the end

Errors

Raise one of these to say how far a failure goes:

Exception Stops
RuntimeJobError this job
RuntimeRunnerError this application's runner
RuntimeServiceError the whole daemon

License

MIT

Metadata

Release files for haps-runtime-executor 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for haps-runtime-executor 0.5.0
File Size Uploaded Provenance Actions
haps_runtime_executor-0.5.0.tar.gz 13.7 kB Without provenance Details for haps_runtime_executor-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for haps-runtime-executor 0.5.0
File Interpreter ABI Platform Actions
haps_runtime_executor-0.5.0-py3-none-any.whl Python 3 none any Details for haps_runtime_executor-0.5.0-py3-none-any.whl

Total release size: 29.8 kB

Release files / haps_runtime_executor-0.5.0.tar.gz

Download URL haps_runtime_executor-0.5.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9c331d87f53f33409086cbcb6295cc8e23e559c55e08005fc77442c26192f3db
BLAKE2b-256 checksum
How to use checksums
351c7fd39b5365f32a7bfcca9e560e48d85c12110e0702f1ddf51ba819942433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / haps_runtime_executor-0.5.0-py3-none-any.whl

Download URL haps_runtime_executor-0.5.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db9d32afeb80930311aa9a8b6e760eb60a20a441bd81e3a62060939778a936ad
BLAKE2b-256 checksum
How to use checksums
15b335eb9e6d66c56284ad2a7d31753a4765e9bfdd1a2d4ac03537a166be33eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for haps-runtime-executor 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page