Middleware
Note
The <Data structure type>
is the object type for a given method’s return. The supported data types are listed here section.
Wrapyfi natively supports a number of middleware. However, more middleware could be added by:
Creating a derived class that inherits from the base classes
wrapyfi.connect.Listener
,wrapyfi.connect.Publisher
,wrapyfi.connect.Client
, orwrapyfi.connect.Server
depending on the communication pattern to be supportedDecorating the classes inside scripts residing within:
the
listeners
directory with@Listeners.register(<Data structure type>, <Communicator>)
the
publishers
directory with@Publishers.register(<Data structure type>, <Communicator>)
the
clients
directory with@Clients.register(<Data structure type>, <Communicator>)
the
servers
directory with@Servers.register(<Data structure type>, <Communicator>)
Appending the script path where the class is defined to the
WRAPYFI_MWARE_PATHS
environment variableEnsure that the middleware communication pattern scripts reside within directories named
listeners
,publishers
,clients
, orservers
nested inside theWRAPYFI_MWARE_PATH
and that the directory contains an__init__.py
file