Metadata-Version: 2.4
Name: momotor-engine-proto
Version: 6.0.1
Summary: Momotor Engine Protocol Library
Author-email: Erik Scheffers <e.t.j.scheffers@tue.nl>
License: GNU Lesser General Public License v3 (LGPLv3)
Project-URL: Homepage, https://momotor.org
Project-URL: Documentation, https://momotor.org/doc/engine/momotor-engine-proto/
Project-URL: Repository, https://gitlab.tue.nl/momotor/engine-py3/momotor-engine-proto/
Project-URL: Tracker, https://gitlab.tue.nl/momotor/engine-py3/momotor-engine-proto/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
Requires-Dist: momotor-engine-shared~=2.0
Requires-Dist: asyncio_extras
Requires-Dist: protobuf<7,>=6.31.1
Requires-Dist: h2~=4.0
Requires-Dist: grpclib<0.5,>=0.4.9
Requires-Dist: py-multihash
Requires-Dist: base58~=2.1
Requires-Dist: backoff
Requires-Dist: multidict
Provides-Extra: test
Requires-Dist: pytest~=8.1; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Provides-Extra: docs
Requires-Dist: momotor-engine-proto[test]; extra == "docs"
Requires-Dist: Sphinx; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints!=1.14.0; extra == "docs"
Requires-Dist: furo; extra == "docs"
Provides-Extra: dev
Requires-Dist: momotor-engine-proto[docs]; extra == "dev"
Requires-Dist: docutils-stubs; extra == "dev"
Requires-Dist: grpcio-tools~=1.76.0; extra == "dev"
Provides-Extra: build
Requires-Dist: momotor-engine-proto[dev]; extra == "build"
Requires-Dist: setuptools; extra == "build"
Requires-Dist: setuptools-scm; extra == "build"
Requires-Dist: build[virtualenv]; extra == "build"
Requires-Dist: python-semantic-release~=10.0; extra == "build"

This package is a part of [Momotor](https://momotor.org/), a tool for automated processing of digital content. 

Momotor accepts digital content as a product bundle and generates a result bundle from this product under 
control of a recipe bundle. 

Momotor is like a continuous integration system, but broader in scope. The 
type of content that Momotor can process is not restricted; each recipe may impose its own constraints. 
One application of Momotor in an educational setting is the automatic generation of feedback on work submitted 
for programming assignments.

---

The `momotor-engine-proto` package provides the Momotor RPC protocol for communication between the Momotor 
broker and clients, and also for the communication between the Momotor broker and workers.

The protocol uses the Google RPC (gRPC) protocol.

### Worker connection recovery

`get_authenticated_channel()` keeps its shared 900-second ping interval. Pass
`keepalive_time=None` to disable transport keepalive. The optional
`keepalive_timeout` sets a positive, finite acknowledgement timeout. It defaults
to the supplied `Configuration` value, or 20 seconds. Both durations reject zero,
negative, non-finite, and boolean values.

Workers can select `keepalive_time=15, keepalive_timeout=10`. An unacknowledged
ping closes the transport within at most 25 seconds of a silent failure, subject
to event-loop scheduling. Reconnect delay and authentication time are additional.
A worker with a 5-second retry cap and 10-second authentication timeout can make
its next connection attempt within 30 seconds and complete an available
connection within 40 seconds. The broker's normal session timeout is 60 seconds.

An outstanding `getTask` counts as an active call even when no work matches.
Repeated pings therefore continue during a healthy long wait. By default, a
channel with no active RPCs sends no pings. Set
`keepalive_permit_without_calls=True` to probe such channels too. The caller must
replace a failed authenticated channel and cancel its old work. A PING proves
transport liveness, not broker application progress or assignment ownership.

A supplied `config=Configuration(...)` provides window sizes, TLS hostname
settings, the acknowledgement timeout, and the idle-call policy. Explicit
keepalive arguments override those policy values. `keepalive_time` always wins,
including its default of 900. The helper permits unlimited pings without DATA
and sets the minimum spacing to the smaller of one second and the ping interval.
Confirm that the broker and intervening proxies permit your chosen ping rate.
A peer that rejects frequent pings can close the connection instead.

Transport tests exercise silent loss, explicit disconnect, idle channels, and
long RPCs over TCP, including certificate-verified TLS, against the installed
`grpclib` version in the supported `>=0.4.9,<0.5` range. The minimum excludes
0.4.7, whose stream reset after a TLS disconnect can raise `AttributeError`.
Policy logs contain durations
and flags, never authentication credentials. `grpclib.protocol` debug logging
provides transport close reasons, including keepalive expiry.
