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

feat: Added env support for prog args #41

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions paladin-core/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@ const HELP_HEADING: &str = "Paladin options";
#[derive(Args, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Default)]
pub struct Config {
/// Determines the serialization format to be used.
#[arg(long, short, help_heading = HELP_HEADING, value_enum, default_value_t = Serializer::Postcard)]
#[arg(long, short, help_heading = HELP_HEADING, value_enum, env = "PALADIN_SERIALIZER", default_value_t = Serializer::Postcard)]
pub serializer: Serializer,

/// Specifies the runtime environment to use.
#[arg(long, short, help_heading = HELP_HEADING, value_enum, default_value_t = Runtime::Amqp)]
#[arg(long, short, help_heading = HELP_HEADING, value_enum, env = "PALADIN_RUNTIME", default_value_t = Runtime::Amqp)]
pub runtime: Runtime,

/// Specifies the number of worker threads to spawn (in memory runtime
/// only).
#[arg(long, short, help_heading = HELP_HEADING)]
#[arg(long, short, help_heading = HELP_HEADING, env = "PALADIN_NUM_WORKERS")]
pub num_workers: Option<usize>,

/// Provides the URI for the AMQP broker, if the AMQP runtime is selected.
#[arg(long, help_heading = HELP_HEADING, env = "AMQP_URI", required_if_eq("runtime", "amqp"))]
#[arg(long, help_heading = HELP_HEADING, env = "PALADIN_AMQP_URI", required_if_eq("runtime", "amqp"))]
pub amqp_uri: Option<String>,

/// Provides the routing key for workers to listen on, if the AMQP runtime
/// is used in configuration.
#[arg(long, help_heading = HELP_HEADING)]
#[arg(long, help_heading = HELP_HEADING, env = "PALADIN_TASK_BUS_ROUTING_KEY")]
pub task_bus_routing_key: Option<String>,
}

Expand Down
2 changes: 1 addition & 1 deletion paladin-core/src/directive/indexed_stream/foldable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct Dispatcher<'a, M: Monoid> {
channel_identifier: String,
}

impl<'a, Op: Monoid + 'static> Dispatcher<'a, Op> {
impl<Op: Monoid + 'static> Dispatcher<'_, Op> {
/// Queue the given [`TaskResult`].
async fn queue(&self, result: TaskOutput<Op, Metadata>) {
self.assembler.queue(result);
Expand Down
Loading