Age | Commit message (Collapse) | Author |
|
feature/add_tedge_api/integrate-api
This merge integrates the latest changes from the API into the
implementation, into an integration branch.
The important change this merges is
commit 10ef8e00bd7c78ed709c933edd92a59cc885e341 ("Change TypeUuid implementation to bevy_reflect")
which changes a part of the plugin API.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
This patch replaces the type_uuid crate with the bevy_reflect
implementation of the functionality.
The rationale for this is, that the implementation of the type_uuid
crate does not support generics, but the bevy_reflect implementation
does.
As we need generic support for type uuids, we change to bevy_reflect
here.
Suggested-by: Marcel Müller <m.mueller@ifm.com>
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
feature/add_tedge_api/integrate-api-changes
This merges the latest changes in the API, which features (mainly) the type-uuid
changes from commit 02bfa3768be59b211daddd9b66203b787fd72153 ("Add TypeUUID to Messages").
This merge is done onto the integration branch, so we can adapt to the
new API in the next few commits and then merge the integration branch
back into the implementation.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
This allows messages to be identified by their UUID. This means that
messages are no longer identified by the internal TypeId as provided
from rustc but our choosing. This allows for more powerful features
along the line, such as external programs being able to specify messages
at all.
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
Signed-off-by: Marcel Müller <m.mueller@ifm.com>
|
|
feature/add_tedge_api/integrate-api
This merges the latest changes from the API branch into an integration
branch for adapting the the core implementation to the changes.
The changes, most notably
commit 43ed68145e7044c0d8f170af794d71c2fa93599a ("Replace tokio MPSC with a direct Future")
were the MPSC interfaces were removed from the API, will result in
quite a few adaptions in the tedge_core crate implementation.
Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com>
|
|
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>
|
|
Merge in the changes in the API that allow catchall message handler
implementations.
Signed-off-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>
|
|
This merge integrates the latest updates to the tedge_api into the
implementation in the feature/add_tedge_api branch, via a integration
helper branch.
Further commits to this branch will adapt our uses of the API to the new
interface so that these changes can then be merged back into
feature/add_tedge_api.
Signed-off-by: Matthias Beyer <matthias.beyer@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>
|
|
Fixes: d010a66edfb4ba557b22d1259bd08deeebc96923 ("Add PluginDirectory::get_address_for_self()")
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>
|
|
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>
|