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.Serverdepending on the communication pattern to be supportedDecorating the classes inside scripts residing within:
the
listenersdirectory with@Listeners.register(<Data structure type>, <Communicator>)the
publishersdirectory with@Publishers.register(<Data structure type>, <Communicator>)the
clientsdirectory with@Clients.register(<Data structure type>, <Communicator>)the
serversdirectory with@Servers.register(<Data structure type>, <Communicator>)
Appending the script path where the class is defined to the
WRAPYFI_MWARE_PATHSenvironment variableEnsure that the middleware communication pattern scripts reside within directories named
listeners,publishers,clients, orserversnested inside theWRAPYFI_MWARE_PATHand that the directory contains an__init__.pyfile