Skip to content

Could async be removed from these functions? #133

@segeljakt

Description

@segeljakt

There are functions that do not contain async code. Currently, I need to use futures::executor::block_on to execute these two functions.

  • rskafka/src/client/mod.rs

    Lines 113 to 115 in bd61405

    pub async fn controller_client(&self) -> Result<ControllerClient> {
    Ok(ControllerClient::new(Arc::clone(&self.brokers)))
    }
  • impl ControllerClient {
    pub(super) fn new(brokers: Arc<BrokerConnector>) -> Self {
    Self {
    brokers,
    backoff_config: Default::default(),
    current_broker: Mutex::new(None),
    }
    }
  • rskafka/src/client/mod.rs

    Lines 118 to 128 in bd61405

    pub async fn partition_client(
    &self,
    topic: impl Into<String> + Send,
    partition: i32,
    ) -> Result<PartitionClient> {
    Ok(PartitionClient::new(
    topic.into(),
    partition,
    Arc::clone(&self.brokers),
    ))
    }

Could async be removed for these two or is there a reason it is used?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions