ivy package¶
Ivy is a lightweight software bus for quick-prototyping protocols. It allows applications to broadcast information through text messages, with a subscription mechanism based on regular expressions.
If you’re used to the standard Ivy API, you probably want to look at the std_api module.
For an introduction of the package, see the Overview and the Tutorial..
Understanding the package¶
This Ivy package is made of two modules: ivy.std_api
and ivy.ivy
.
In order to understand the way it works, we highly suggest that you read the materials available from the Ivy Home Page in addition to our tutorial. Within the documentation of this python package we suppose that you are already familiar with the way an ivy bus works, and with how the corresponding framework is organized.
ivy.std_api
¶
Once familiar with the ivy framework, you’ll find in the std_api module the exact API you’re expecting (see for example the The Ivy C library).
An example of use, directly taken from the original swig-base python release,
is included with the package, see examples/pyhello.py
.
Important
One big difference with the original implementation is that
there is nothing like a “main loop”: the server is activated as soon as the
method ivy.std_api.IvyStart()
is called, and the
ivy.std_api.IvyMainLoop()
method simply waits for the server to
terminate (the server runs in a separate thread).
ivy.ivy
¶
It’s where the logic is implemented: the module std_api is built on top of it.
This package allows to manage more than one ivy bus in an application. Refer to the implementation of the ivy module for an example of how to use it.
Logging¶
The module issues messages through python’s standard
logging
module:
logger’s name:
'Ivy'
default level:
logging.INFO
default handler: a
logging.StreamHandler
logging messages to the standard error stream.For example, if you need to see all messages issued by the package, including debug messages, use the following code excerpt:
import logging logging.getLogger('Ivy').setLevel(logging.DEBUG)Further details can be found in the Python standard documentation.
Supported python¶
Python 3.7 or higher is needed.
Note
ivy-python v3.3 was the last one supporting Python 2.7.
Misc. notes¶
direct msg: to app_name == the last one registered w/ that name (for example register ivyprobe 3 times and send a direct msg to IVYPROBE from one of them)
regexps order and ids: ivyprobe e.g. subscribes regexp in reverse order of ids. For each match, send the appropriate message. documented.
License¶
This software is distributed under the “new” BSD license,
(please refer the file LICENSE
for full legal details)
Copyright (c) 2005-2023 Sebastien Bigaret <sebastien.bigaret@telecom-bretagne.eu>
Submodules¶
- ivy.ivy module
- Using an IvyServer
- Implementation details
ClientsBinding
IvyClient
IvyClient.end_init()
IvyClient.get_next_ping_delta()
IvyClient.get_next_ping_delta_ns()
IvyClient.remove_subscription()
IvyClient.send_die_message()
IvyClient.send_direct_message()
IvyClient.send_error()
IvyClient.send_message()
IvyClient.send_new_subscription()
IvyClient.send_ping()
IvyClient.send_pong()
IvyClient.start_init()
IvyClient.wave_bye()
IvyHandler
IvyIllegalStateError
IvyMalformedMessage
IvyProtocolError
IvyServer
IvyServer.add_client_binding()
IvyServer.bind_direct_msg()
IvyServer.bind_msg()
IvyServer.bind_pong()
IvyServer.bind_regexp_change()
IvyServer.get_client()
IvyServer.get_client_bindings()
IvyServer.get_client_with_name()
IvyServer.get_clients()
IvyServer.get_subscriptions()
IvyServer.handle_die_message()
IvyServer.handle_direct_msg()
IvyServer.handle_msg()
IvyServer.handle_new_client()
IvyServer.handle_pong()
IvyServer.handle_regexp_change()
IvyServer.isAlive()
IvyServer.ivybus
IvyServer.port
IvyServer.register_client()
IvyServer.remove_client()
IvyServer.remove_client_binding()
IvyServer.run_callback()
IvyServer.send_direct_message()
IvyServer.send_msg()
IvyServer.send_ready_message()
IvyServer.serve_forever()
IvyServer.server_termination
IvyServer.start()
IvyServer.stop()
IvyServer.unbind_msg()
IvyServer.usesDaemons
IvyTimer
UDP_init_and_listen()
decode_MSG_params()
decode_ivybus()
decode_msg()
encode_message()
is_multicast()
trace()
void_function()
- ivy.std_api module
IvyBindDirectMsg()
IvyBindMsg()
IvyBindPong()
IvyBindRegexpChange()
IvyGetApplication()
IvyGetApplicationHost()
IvyGetApplicationList()
IvyGetApplicationMessages()
IvyGetApplicationName()
IvyGetMessages()
IvyInit()
IvyMainLoop()
IvySendDieMsg()
IvySendDirectMsg()
IvySendError()
IvySendMsg()
IvySendPing()
IvySetPongCallback()
IvyStart()
IvyStop()
IvyTimerModify()
IvyTimerRemove()
IvyTimerRepeatAfter()
IvyUnBindMsg()
IvyUnbindMsg()
void_function()