Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[32] Allow modules to show warnings #203

Merged

Conversation

azenna
Copy link
Contributor

@azenna azenna commented Sep 15, 2023

Allow modules to show warnings

Implementation

Uses ctx to allow adding a warning to running status

I have

  • run cargo fmt;
  • run cargo clippy;
  • run cargo testand all tests pass;
  • linked to the originating issue (if applicable).

resolves #32

Copy link
Member

@banditopazzo banditopazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add_warning should be inside ModuleSender instead of PulsarDaemonHandle .

errors and warning handling happens inside the ModuleManager leading to an update of the module status.

you can modify error_sender inside ModuleSender :

    pub(crate) error_sender: ErrorSender,

renaming it for example to signal_sender and using a channel not only for errors. in the channel you can send a new enum made with an error and a warning variants

}

/// Status of loaded module.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum ModuleStatus {
Created,
Running,
Running(Option<String>),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's better to use a Vec<String> to capture multiple warnings

@azenna azenna force-pushed the 32-allow-modules-to-show-warnings branch from 226ae7d to 089cfb3 Compare September 18, 2023 16:41
@azenna azenna force-pushed the 32-allow-modules-to-show-warnings branch from 089cfb3 to fd6a6f1 Compare September 18, 2023 16:44
@azenna
Copy link
Contributor Author

azenna commented Sep 18, 2023

Yeah that makes way more sense, sorry!

Copy link
Member

@banditopazzo banditopazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@banditopazzo banditopazzo merged commit ee0180e into exein-io:main Sep 19, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow modules to show warnings
2 participants