Age | Commit message (Collapse) | Author |
|
MPSC are a heavy form of indirection that is potentially not needed.
This patch removes them and instead opts to use a Fn Generator of
futures that correspond to the model of communication One Question ->
One Reponse.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Reviewed-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
This patch adds the ability to send any kind of messages to plugins that
declare handling `AnyMessage` + `AnyMessages`.
It does it with these changes:
- Remove the `Message::Reply` associated type
- This allows `Message` to be used as a trait object
- Add the `MessageType` which allows to identify messages
- This permits `AnyMessage` to be received by plugins
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Make it clear that sending messages can potentially block indefinitely
if the target plugin does not handle them.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
While having spanning information is very important for good error
messages, the current system is not very well suited for it anyway. This
patch removes the spanned wrapper to simplify current implementations,
with an outlook to a better replacement.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
This trait simplifies a lot of the message calls in the PluginBuilder.
Advantages: You only declare a list of handled messages _once_. This is
necessary since Rust does not allow 'queries' for types (aka "give me a
tuple of supported types" does not exist), and so the necessary crutch
is to declare them manually.
Disadvantages: You cannot pick at Runtime anymore what messages you
decide to support. This is considered to be a very niche use-case and
might actually be an anti-pattern.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
This patch adds a dedicated error type for the PluginDirectory trait
interface.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Previously they were mixed up, having them separate makes it clear that
the bundle made by the `make_receiver_bundle` macro are only meant to be
used for _receiving_ plugins.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
|
|
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
This makes the name clearer and shows that one speaks to the Core that
orchestrates the rest.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
`Message::new()` was made private, so we must use `Comms::new_message()`
now. This change was missing in the commit that changed that interface.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Fixes: ca5672eebbbdf61ee1994dd0ea13346d117cb755 ("Add Comms::new_message()")
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
This patch adds the Comms::new_message() function, which can be used to
construct a new message with the origin automatically set correctly.
When the Comms object is passed to a plugin, the plugin can use this
function to automatically create a message that contains the right
origin.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
Having only a single message type makes the implementation easier and
allows for a leaner core. This in turn allows for easier abstractions on
the plugin side, as only a single type of messages exists.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
This makes it clearer on what name refers to here. As both in the config
and in the plugin builder you'd have a 'name' property. Renaming this to
'kind name' makes it clear which part it refers to.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
Allowing them to be async means that they can do slightly more
complicated methods of checking configuration and instantiating
plugins. (Like IO to check for file existence, etc..)
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
This patch makes the PluginBuilder::instantiate() function failable.
A plugin may fail during its instantiation (simple things like out of
disk, permission errors, but also more sophisticated things like
business-case errors).
Thus, the instantiation should be failable, to allow proper reporting on
the thin-edge side of things as well as graceful shutdown if needed.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
The verification the `PluginBuilder` does not need to get the object, it
is totally sufficient for the verification if it gets only a reference
to it.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
A very simple service that is meant to showcase how plugins can be built
and their lifecycles.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|