Python client
microrti is the Python package for writing HLA 4 federates: the federate interface of IEEE
1516.1-2025 and the data encoding of IEEE 1516.2-2025. It is a thin layer, built with PyO3, over the
MicroRTI Rust client. It talks the Federate Protocol to any HLA 4 RTI and also contains an RTI that runs
inside your process. The source, the issue tracker and the examples are at
github.com/microrti/microrti-python, under the Apache
License 2.0.
If you have not used it yet, Your first federate in Python walks through installation and two working federates. This page is the reference that follows it.
What the package covers
| Part | Content |
|---|---|
RtiAmbassador | every federate-initiated service of clauses 4 to 10 as a blocking method: the 178 Federate Protocol request messages, plus Evoke Callback, Evoke Multiple Callbacks, Enable Callbacks and Disable Callbacks |
FederateAmbassador | one method per callback, 62 in all, each doing nothing until you override it |
microrti.callbacks | the same 62 callbacks as frozen dataclasses, for code that prefers match |
| Transports | TCP, TLS 1.3, WebSocket and secure WebSocket to an RTI server, or EmbeddedRti in the process |
| Callback models | EVOKED and IMMEDIATE, with the interpreter lock released while a service waits |
| Logical time | HLAinteger64Time and HLAfloat64Time with their intervals, the two representations the standard defines |
microrti.encoding | encoding and decoding of the data types of the standard MIM and of your FOM modules |
| Errors | one Python class per exception of the standard (100 of them), all under microrti.RtiError |
| Typing | type stubs for the whole API and a py.typed marker |
MicroRTI, this package included, is not certified and has not been through a formal conformance test.
Installation
The current version is 0.3.0, built on the MicroRTI crates 0.5.0. It is not on PyPI: install it from the v0.3.0 release on GitHub, which has prebuilt wheels for Linux and the source archive. You need Python 3.11 or later.
| System | File of the release |
|---|---|
| Linux, glibc 2.28 or later, x86-64 | microrti-0.3.0-cp311-abi3-manylinux_2_28_x86_64.whl |
| Linux, glibc 2.28 or later, ARM64 | microrti-0.3.0-cp311-abi3-manylinux_2_28_aarch64.whl |
| Linux, musl 1.2 or later (Alpine), x86-64 | microrti-0.3.0-cp311-abi3-musllinux_1_2_x86_64.whl |
| Linux, musl 1.2 or later (Alpine), ARM64 | microrti-0.3.0-cp311-abi3-musllinux_1_2_aarch64.whl |
| anything else, with Rust 1.88 or later | microrti-0.3.0.tar.gz, compiled by pip |
pip installs a file of the release from its URL. On Linux with glibc:
pip install "https://github.com/microrti/microrti-python/releases/download/v0.3.0/microrti-0.3.0-cp311-abi3-manylinux_2_28_$(uname -m).whl"Elsewhere, such as on macOS:
pip install https://github.com/microrti/microrti-python/releases/download/v0.3.0/microrti-0.3.0.tar.gzThe compilation took about a minute on an ARM Mac. The release also has a SHA256SUMS file with the
checksum of every file.
The wheels are tagged for the stable ABI of CPython 3.11, so one file serves Python 3.11 and every later
version; the package built for this page ran the tutorial under Python 3.11 and 3.14. It does not load in
a free-threaded build of Python. To install on machines without Rust where there is no prebuilt wheel,
build a wheel once with pip wheel <archive or URL> -w dist and copy the file (here
microrti-0.3.0-cp311-abi3-macosx_11_0_arm64.whl) to the other machines of the same platform. The
continuous integration of the repository builds the package on Linux and runs its tests there with
Python 3.11 to 3.15.
Connect to an RTI
RtiAmbassador() reaches an RTI over the Federate Protocol (12.13). The RTI address you give to
Connect picks the transport:
| Address | Transport | Default port |
|---|---|---|
tcp://host[:port], or a bare host[:port] | TCP | 15164 |
tls://host[:port] | TLS 1.3 | 15165 |
ws://host[:port][/path] | WebSocket | 80 |
wss://host[:port][/path] | secure WebSocket | 443 |
The simplest form passes the address as a string:
from microrti import CallbackModel, RtiAmbassador
rti = RtiAmbassador()
rti.connect_with_configuration(my_federate_ambassador, CallbackModel.EVOKED, "tcp://rti.example.org:15164")The listener.py and talker.py federates of the tutorial ran unchanged over TCP and then over the
three other transports of one microrti server (--listen tls://127.0.0.1:0 --listen ws://127.0.0.1:0 --listen wss://127.0.0.1:0 --tls-self-signed); only the address changed.
Settings and credentials
RtiConfiguration carries the address and the additional settings, one KEY=VALUE per line.
Credentials.plain_text_password gives the HLAplainTextPassword credentials of 12.6, for an RTI
started with --authorization true:
from microrti import CallbackModel, Credentials, RtiAmbassador, RtiConfiguration
configuration = RtiConfiguration(
"tls://rti.example.org",
additional_settings="TLS_TRUST_ANCHORS=ca.pem\nFED_TIMEOUT_RECONNECT=30",
)
rti = RtiAmbassador()
rti.connect(my_federate_ambassador, CallbackModel.IMMEDIATE, configuration,
Credentials.plain_text_password("sesame"))The client reads the keys that start with FED_ or TLS_. They are the keys of the Rust client;
times are in seconds:
| Key | Meaning | Default |
|---|---|---|
FED_INT_HEART | idle time after which the client sends a heartbeat | 60 |
FED_TIMEOUT_HEART | silence of the RTI after which the connection is given up and resumed | 180 |
FED_TIMEOUT_RECONNECT | time after which resuming stops and the connection is lost | 600 |
FED_INT_RECONNECT | pause between two reconnection attempts | 1 |
FED_TIMEOUT_CONNECT | limit on one connection attempt and on the start of the session | 10 |
TLS_TRUST_ANCHORS | PEM file with the certificates the RTI certificate must chain to | none |
TLS_SERVER_NAME | name the RTI certificate must match, when it is not the host of the address | the host |
Without TLS_TRUST_ANCHORS, TLS encrypts the connection but does not check who the RTI is. With it,
a server whose certificate does not chain to those anchors is refused:
ConnectionFailed: cannot reach the RTI: tls://localhost:59200: transport error: TLS handshake with tls://localhost:59200 failed: invalid peer certificate: UnknownIssuerThe whole text of the settings also travels to the RTI in the Connect request. Connect returns a
ConfigurationResult: the answer of the RTI, completed with what the client itself did with the
configuration (4.2). With FED_INT_HEART=5 and color=blue over TCP, against a microrti server:
ConfigurationResult(configuration_used=False, address_used=True, additional_settings_result_code=<AdditionalSettingsResultCode.SETTINGS_APPLIED: 2>, message='applied on the federate side: FED_INT_HEART; additional settings ignored by the RTI: color')address_used is True because the client reached the RTI at the address given. The client applied
FED_INT_HEART, hence SETTINGS_APPLIED; the server uses none of the FED_ and TLS_ keys and names
the other keys it ignores.
A misspelt key, or a value the client cannot read, does not stop Connect: the connection is made without
that line, the code is SETTINGS_FAILED_TO_PARSE, and message gives the line and the reason. With
FED_TIMEOUT_CONECT=5:
not usable on the federate side: line 1: FED_TIMEOUT_CONECT: unknown setting (known: FED_INT_HEART, FED_TIMEOUT_HEART, FED_TIMEOUT_RECONNECT, FED_INT_RECONNECT, FED_TIMEOUT_CONNECT, TLS_TRUST_ANCHORS, TLS_SERVER_NAME)Check the result when you pass settings: the client raises nothing for a line it drops. Over tls://
and wss://, a TLS_ line the client cannot use is different, because it may be the trust anchors
written wrong, and connecting without them would skip the check of the RTI certificate. Connect fails
instead, a deliberate departure of MicroRTI from 4.2. With TLS_TRUST_ANCHOR=ca.pem, the key misspelt:
ConnectionFailed: cannot reach the RTI: additional settings, line 1: TLS_TRUST_ANCHOR: unknown setting (known: FED_INT_HEART, FED_TIMEOUT_HEART, FED_TIMEOUT_RECONNECT, FED_INT_RECONNECT, FED_TIMEOUT_CONNECT, TLS_TRUST_ANCHORS, TLS_SERVER_NAME): over TLS such a line may be the trust anchors written wrong, and the RTI certificate cannot be validated as asked; no connection is madeAgainst a server that requires a password, a wrong one raises Unauthorized with the detail
wrong password, and no credentials at all gives this RTI requires credentials. The password travels
in the clear inside the connection, so use tls:// or wss://. Setting up the server side is in
TLS and authorisation.
Losing the connection
When the connection breaks, the session layer of the Federate Protocol reconnects and resumes the
session without the federate noticing. When that has not worked within FED_TIMEOUT_RECONNECT, the
federate ambassador receives connection_lost and services raise NotConnected. With
FED_TIMEOUT_RECONNECT=2 and the server killed, this is what a federate saw:
connection_lost after 2.0 s: timeout: the session could not be resumed within FED_TIMEOUT_RECONNECT (2s)
is_connected False
NotConnected | not connected to an RTIClosing, and a time limit on services
rti.close() ends the connection without Disconnect, whatever state the federate is in: if it is still
joined, the RTI resigns it with its automatic resign directive, as it does for a lost federate (4.1.6).
close never fails, does nothing when the ambassador is not connected, and may be called inside a
callback, where Disconnect may not. A with block calls it at its end, also when an exception leaves
the block:
with RtiAmbassador() as alice:
alice.connect_with_configuration(None, CallbackModel.EVOKED, address)
alice.create_federation_execution("Greetings", FOM)
alice.join_federation_execution_with_name("alice", "greeter", "Greetings")
print("connected after the block:", alice.is_connected())connected after the block: FalseThe server logged federate lost ... federate=alice for it. A federate that resigns and disconnects
itself needs none of this.
By default a service waits for the RTI as long as the connection lasts. rti.with_call_timeout(seconds)
returns another handle to the same ambassador whose services give up after that long, with an
RTIinternalError that microrti.is_call_timeout(error) recognises; call_timeout() reads the limit
(None for none). Here the module of Create Federation Execution was named by an http: URL whose
server never answered:
bounded = rti.with_call_timeout(1.0)
try:
bounded.create_federation_execution("Slow", FomModule.url(slow_url))
except microrti.RTIinternalError as error:
print(microrti.is_call_timeout(error), "|", error)True | no response from the RTI within the call timeout of 1s to CreateFederationExecutionRequest; the RTI may still carry it out, its response will be ignoredThe RTI may still carry out a service that was given up, so do not simply call it again.
evoke_callback_counted(seconds) and evoke_multiple_callbacks_counted(minimum, maximum) are Evoke
Callback and Evoke Multiple Callbacks returning an EvokeOutcome, with the number of callbacks
delivered: EvokeOutcome(delivered=0, pending=False) for an idle federate. close, the time limit and
the counted evocations are extensions of MicroRTI, not services of the standard.
The RTI inside the process
EmbeddedRti() is an RTI in your Python process, and embedded.ambassador() gives an RTI ambassador
connected to it by function calls. Any number of ambassadors can share one embedded RTI, from one thread
or many. The constructor takes two keyword arguments: password, to require
Credentials.plain_text_password(password) at Connect, and tick_period, the period in seconds of the
RTI’s work driven by the wall clock.
It reads the FOM modules named by URL as the server does by default. embedded.set_fom_url_policy()
restricts that, with FomUrlPolicy.refused() or FomUrlPolicy.directory(path), and
embedded.set_fom_url_reader(FomUrlReader(policy).with_timeout(seconds)) also sets the time limit, 30
seconds by default (An RTI inside your process).
embedded.register("embedded") makes the embedded RTI reachable by a plain RtiAmbassador() at the
address embedded: (the result of Connect then has address_used=True). A federate that takes its RTI
address from the command line can then run against the in-process RTI in a test, and against a server
otherwise, without a code change. There is no network session in between, so the result names any FED_
or TLS_ key as without effect on the federate side.
An RTI inside your process covers the idea for both clients.
Callbacks
Connect takes the receiver of the callbacks as its first argument, in one of three forms:
- an instance of a
FederateAmbassadorsubclass, whose methods are called; - any callable taking one argument, which receives each callback as a value from
microrti.callbacks; None, for a federate that ignores callbacks.
A callable fits well with a queue and match. This runs as it is:
import queue
from microrti import CallbackModel, EmbeddedRti, callbacks
events = queue.Queue()
rti = EmbeddedRti().ambassador()
rti.connect(events.put, CallbackModel.IMMEDIATE) # callbacks arrive on a thread of the ambassador
rti.list_federation_executions()
match events.get(timeout=10):
case callbacks.ReportFederationExecutions(report=report):
print(f"{len(report)} federation executions")
case other:
print(f"unexpected: {other}")
rti.disconnect()0 federation executionsCallback models and the interpreter lock
| Model | Where callbacks run |
|---|---|
CallbackModel.EVOKED | on the thread that calls evoke_callback(seconds) (10.57) or evoke_multiple_callbacks(minimum, maximum) (10.58), and only then |
CallbackModel.IMMEDIATE | as they arrive, on a thread owned by the RTI ambassador, alongside your own code: protect what they share |
In both models:
- The callbacks of one federate never run concurrently, and they arrive in the order the RTI sent them.
- Every service releases the interpreter lock while it waits for the RTI, so other Python threads keep running, and several threads may use one RTI ambassador.
- A callback may call any service except Connect, Disconnect, Join Federation Execution, Resign
Federation Execution, Evoke Callback and Evoke Multiple Callbacks, which raise
CallNotAllowedFromWithinCallback(see 12.8). For example:CallNotAllowedFromWithinCallback: Resign Federation Execution cannot be invoked from within a callback. - An exception raised in a callback does not stop delivery and does not come out of
evoke_callback. It is logged with its traceback on the loggermicrorti(for examplethe callback ReceiveInteraction failed) and reported to the RTI as a failed callback (FederateInternalError).KeyboardInterruptandSystemExitare logged the same way but, in theEVOKEDmodel, the evoke call raises them again, sosys.exit()in a callback does end the program. - Ctrl-C interrupts a waiting
evoke_callbackorevoke_multiple_callbacks. In nine tries on a busy machine,evoke_callback(30.0)raisedKeyboardInterruptat most 0.21 s after the signal, and within 0.08 s in seven of them.
The FederateAmbassador class
Subclass FederateAmbassador and override the callbacks you need; the others do nothing. Method and
argument names are those of the Rust client, which are the names of the standard in snake case:
discover_object_instance, reflect_attribute_values, receive_interaction,
time_advance_grant, connection_lost and so on. Each docstring names the callback and its clause
(Receive Interaction callback (6.13)).
import microrti
from microrti import FederateAmbassador
from microrti.encoding import decode
class Listener(FederateAmbassador):
def __init__(self) -> None:
self.names: dict[microrti.ObjectInstanceHandle, str] = {}
def discover_object_instance(self, object_instance, object_class, object_instance_name,
producing_federate) -> None:
print(f"listener: discovered the object instance {object_instance_name}")
def reflect_attribute_values(self, object_instance, attribute_values, user_supplied_tag,
transportation_type, producing_federate, sent_regions) -> None:
for value in attribute_values.values():
self.names[object_instance] = decode("HLAunicodeString", value)All callbacks go through one method, handle_callback(callback), which by default calls the method
for that callback. Override handle_callback instead if you want the values of microrti.callbacks
inside a subclass.
Services, arguments and results
A service is a method of RtiAmbassador named after its Federate Protocol message, in snake case:
update_attribute_values_with_time, query_galt, join_federation_execution_with_name. The
docstring names the service and its clause: the one of time_advance_request begins
Time Advance Request service (8.8). Values cross the boundary as plain Python:
| HLA | Python |
|---|---|
| handles | ObjectClassHandle, AttributeHandle and the others: immutable, hashable and ordered; bytes(handle) is the encoded form |
| sets of handles | any iterable going in, a set coming out |
| attribute and parameter values | a dict from handle to bytes |
| user-supplied tag | bytes, which you may leave out when it is the last argument |
| logical time | HLAinteger64Time, HLAfloat64Time and their intervals; a plain int or float argument takes the representation of the joined federation execution |
| enumerations | enum.Enum classes such as ResignAction.DELETE_OBJECTS or OrderType.TIMESTAMP |
| FOM modules | FomModule.file(path), .content(name, text), .compressed(zip), .url(url); a path alone means a file, read on the federate’s machine and sent with its content. With .url, the RTI reads the module: the microrti server and EmbeddedRti read file:, http: and https: URLs by default and refuse a name without a scheme, such as FomModule.url("Chat.xml"), with CouldNotOpenFOM (FOM modules named by URL) |
| results the RTI may not have | None, as from query_galt when there is no GALT |
| small records | named tuples, such as JoinResult(federate_handle, logical_time_implementation_name, time_kind) |
A federation execution created without a time representation uses HLAfloat64Time.
create_federation_execution_with_time(name, fom, "HLAinteger64Time") picks the other one; any other
name raises CouldNotCreateLogicalTimeFactory (the RTI provides HLAfloat64Time and HLAinteger64Time).
Data encoding
The RTI carries attribute and parameter values as bytes. microrti.encoding converts them by the name
of the data type: encode and decode know the data types of the standard MIM, and FomCodec adds
those of your FOM modules.
from microrti.encoding import decode, encode
print(encode("HLAinteger32BE", 42))
print(encode("HLAunicodeString", "hi"))
print(decode("HLAunicodeString", encode("HLAunicodeString", "été")))
print(decode("HLAboolean", b"\x00\x00\x00\x01"))
print(encode("HLAfloat64BE", 1.5))b'\x00\x00\x00*'
b'\x00\x00\x00\x02\x00h\x00i'
été
True
b'?\xf8\x00\x00\x00\x00\x00\x00'For the data types of a FOM, build a codec from its modules (paths or FomModule values). Records
become dicts, arrays become lists, and enumerators carry a name and a number:
from microrti import FomModule
from microrti.encoding import FomCodec
codec = FomCodec([FomModule.content("Types.xml", """<?xml version="1.0"?>
<objectModel xmlns="http://standards.ieee.org/IEEE1516-2025">
<dataTypes>
<enumeratedDataTypes><enumeratedData><name>Color</name><representation>HLAinteger32BE</representation>
<enumerator><name>Red</name><value>1</value></enumerator>
<enumerator><name>Green</name><value>2</value></enumerator>
</enumeratedData></enumeratedDataTypes>
<fixedRecordDataTypes><fixedRecordData><name>Pixel</name><encoding>HLAfixedRecord</encoding>
<field><name>X</name><dataType>HLAinteger16BE</dataType></field>
<field><name>Y</name><dataType>HLAinteger16BE</dataType></field>
<field><name>Color</name><dataType>Color</dataType></field>
</fixedRecordData></fixedRecordDataTypes>
</dataTypes>
</objectModel>""")])
encoded = codec.encode("Pixel", {"X": 3, "Y": 4, "Color": "Green"})
print(encoded)
print(codec.decode("Pixel", encoded))b'\x00\x03\x00\x04\x00\x00\x00\x02'
{'X': 3, 'Y': 4, 'Color': Enumerator(name='Green', value=2)}codec.attribute_data_type("Participant", "Name") and codec.parameter_data_type("Communication", "Message") return the data type the FOM declares (HLAunicodeString for the chat FOM of the
examples), so a generic federate can decode values it did not know in advance. The docstring of
microrti.encoding lists how each kind of data type maps to Python.
Errors are specific: a value that does not fit raises CouldNotEncode (70000 is outside the range -32768..=32767 of HLAinteger16BE), malformed bytes raise CouldNotDecode (truncated input: 4 octet(s) needed at offset 0, 1 remaining), and an unknown data type name raises KeyError.
Exceptions
Each exception of the standard is a class in the microrti module, a subclass of microrti.RtiError.
str(error) is the detail message, and the class attribute exception_name is the name in the
standard. Some you will meet early:
| Exception | Example detail |
|---|---|
ConnectionFailed | cannot reach the RTI: tcp://127.0.0.1:50097: transport error: cannot connect to tcp://127.0.0.1:50097: Connection refused (os error 61) |
FederationExecutionAlreadyExists | a federation execution named 'Greetings' exists already |
FederationExecutionDoesNotExist | there is no federation execution named 'NoSuchFederation' |
FederateNameAlreadyInUse | the federate name 'alice' is in use by federate 1 |
NameNotFound | there is no interaction class named 'Greting' |
InteractionClassNotPublished | the federate does not publish the interaction class HLAinteractionRoot.Greeting |
FederatesCurrentlyJoined | federation execution 'Greetings' has joined federates: alice |
CouldNotOpenFOM | nosuchfile.xml: No such file or directory (os error 2) |
An argument of the wrong Python type is a TypeError that names the argument:
argument 'interaction_class': expected InteractionClassHandle, got str.
Type stubs
The package ships stubs for the whole API (_native.pyi, generated with the service layer) and a
py.typed marker, so mypy and editors know every method, argument and return type. After
pip install mypy in the same environment, mypy typed.py on this file:
import microrti
from microrti import CallbackModel, EmbeddedRti
rti = EmbeddedRti().ambassador()
rti.connect(None, CallbackModel.EVOKED)
result = rti.join_federation_execution_with_name("alice", "greeter", "Greetings")
reveal_type(result)
reveal_type(rti.get_interaction_class_handle("Greeting"))
rti.get_parameter_handle("Greeting", "Text")gives:
typed.py:7: note: Revealed type is "tuple[microrti._native.FederateHandle, str, microrti._types.TimeKind, fallback=microrti._types.JoinResult]"
typed.py:8: note: Revealed type is "microrti._native.InteractionClassHandle"
typed.py:9: error: Argument 1 to "get_parameter_handle" of "RtiAmbassador" has incompatible type "str"; expected "InteractionClassHandle" [arg-type]
Found 1 error in 1 file (checked 1 source file)Examples in the repository
The examples/ directory of the repository has three federates. All three use the FOM module
examples/fom/Chat.xml: an object class Participant with the attribute Name, and an interaction
class Communication with the parameters Sender and Message. Run them from a clone of the
repository (git clone https://github.com/microrti/microrti-python.git), with the package installed.
two_federates.py
Two federates in one script on the embedded RTI. A publisher registers an object instance and updates
its Name attribute; a subscriber written as a FederateAmbassador subclass discovers the instance and
reflects the update.
python examples/two_federates.pylistener: discovered the object instance HLAobject-1
listener: its name is Alice
donetime_management.py
Time management (clause 8) with two federates on two threads, IMMEDIATE callbacks and an embedded RTI.
The time-regulating clock sends one timestamped interaction per step and advances its logical time by
one each time. The time-constrained follower asks for time 5 at once; the RTI delivers each tick in
timestamp order and grants the follower time 5 only when the clock’s progress allows it.
python examples/time_management.pyclock: granted 1
follower: at 1 received tick 1 (TIMESTAMP)
follower: at 2 received tick 2 (TIMESTAMP)
clock: granted 2
follower: at 3 received tick 3 (TIMESTAMP)
clock: granted 3
follower: at 4 received tick 4 (TIMESTAMP)
clock: granted 4
follower: at 5 received tick 5 (TIMESTAMP)
follower: granted 5
clock: granted 5
doneThe lines of the two threads interleave differently from one run to the next; the follower’s own lines always come in this order. Logical time, explained covers the ideas behind it.
chat.py
A chat room over the network: each line you type is sent as a Communication interaction, and each
participant registers a Participant object so that the others see who comes and goes. It needs a
server (microrti --listen tcp://127.0.0.1:0, then use the address it prints) and takes --rti,
--name, --federation (the room, Chat by default) and --callback-model (immediate by default,
or evoked). Ctrl-D leaves.
python examples/chat.py --name alice --rti tcp://127.0.0.1:59218
python examples/chat.py --name bob --rti tcp://127.0.0.1:59218 # in another terminalAlice typed hi bob, bob answered, then bob pressed Ctrl-D. Alice’s terminal:
* alice joined Chat at tcp://127.0.0.1:59218; type a line to say it, end the input (Ctrl-D) to leave
* bob joined
<bob> hello alice, bob here
* bob left
* left Chat; the room is closedBob’s terminal:
* bob joined Chat at tcp://127.0.0.1:59218; type a line to say it, end the input (Ctrl-D) to leave
* alice joined
<alice> hi bob
* left Chatchat.py uses the FOM and the conventions of the Rust chat example of the MicroRTI repository, so the
two share a room. With the Rust program as bob (in a clone of the MicroRTI repository,
cargo run -p microrti-examples --bin chat -- --name bob --rti tcp://127.0.0.1:59218), both
transcripts were the same as above. They were the same again with two Python participants started with
--callback-model evoked.
Relation to the Rust client
The package wraps the Rust crate microrti-client and lets it do the work: the Federate Protocol
session, reconnection, the embedded RTI and the HLA encoding are Rust code shared with Rust federates.
The Python layer converts values, carries callbacks into Python and keeps the interpreter lock out of the
way. Names follow the Rust client on purpose, so the Rust client documentation
and the docstrings describe the same services.
Version 0.3.0 of the package is built on the MicroRTI crates 0.5.0 from crates.io. For the network runs
on this page, it reached a microrti server of version 0.5.0 over the standard Federate Protocol; that
includes the chat in which a Python and a Rust federate shared a room, the scripts of
your first federate in Python over all four transports, and the
TLS connection with a password of TLS and authorisation.
Limits
- Services block. There is no
asynciointerface; call them from a worker thread, for example withasyncio.to_thread, if your program is built on asyncio. - Ctrl-C interrupts the evoke calls, but not a service waiting for an RTI that has gone silent: that call
ends when the connection is declared lost (see
FED_TIMEOUT_RECONNECT). - Logical time is limited to
HLAinteger64TimeandHLAfloat64Time. - The regions conveyed with a callback arrive as a
listofdict, because adictcannot be a member of aset. - An ambassador still connected when the interpreter exits is not disconnected for you, and the RTI sees
the connection drop. Call
resign_federation_executionanddisconnectbefore you exit, or use the ambassador in awithblock, which closes it.