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.4.1

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.4.1
File Size Uploaded Provenance Actions
haps_runtime_executor-0.4.1.tar.gz 13.8 kB Without provenance Details for haps_runtime_executor-0.4.1.tar.gz

Built distribution (wheel)

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

Total release size: 29.8 kB

Release files / haps_runtime_executor-0.4.1.tar.gz

Download URL haps_runtime_executor-0.4.1.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0ce34bf4b5c9259e7b92a9ceb13500b1065a7525c4a49c8401282fd386f52c5f
BLAKE2b-256 checksum
How to use checksums
4694146745a16b82d0df67d1fb6dc317aab0fa1852df54861776a15fa0e9b2ef
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.4.1-py3-none-any.whl

Download URL haps_runtime_executor-0.4.1-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8bf938e9bc8c6ea6895562beac7e5563b050a5d4ac419e2a1eb29cf55079b8e5
BLAKE2b-256 checksum
How to use checksums
e50c663f0b844651ed804b007a139cfc6c02b9ae0ae85c3401a88890604145b9
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.4.1

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