Skip to content

Commit

Permalink
change all stream methods to async fn
Browse files Browse the repository at this point in the history
  • Loading branch information
insipx committed Jul 19, 2024
1 parent 11a51ca commit 997d922
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bindings_ffi/src/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ impl FfiConversations {
Ok(convo_list)
}

pub fn stream(&self, callback: Box<dyn FfiConversationCallback>) -> FfiStreamCloser {
pub async fn stream(&self, callback: Box<dyn FfiConversationCallback>) -> FfiStreamCloser {
let client = self.inner_client.clone();
let handle =
RustXmtpClient::stream_conversations_with_callback(client.clone(), move |convo| {
Expand All @@ -629,7 +629,7 @@ impl FfiConversations {
FfiStreamCloser::new(handle)
}

pub fn stream_all_messages(
pub async fn stream_all_messages(
&self,
message_callback: Box<dyn FfiMessageCallback>,
) -> FfiStreamCloser {
Expand Down Expand Up @@ -1117,7 +1117,7 @@ impl FfiGroup {
Ok(())
}

pub fn stream(&self, message_callback: Box<dyn FfiMessageCallback>) -> FfiStreamCloser {
pub async fn stream(&self, message_callback: Box<dyn FfiMessageCallback>) -> FfiStreamCloser {
let inner_client = Arc::clone(&self.inner_client);
let handle = MlsGroup::stream_with_callback(
inner_client,
Expand Down Expand Up @@ -1266,7 +1266,7 @@ impl FfiStreamCloser {
}
}

#[uniffi::export]
#[uniffi::export(async_runtime = "tokio")]
impl FfiStreamCloser {
/// Signal the stream to end
/// Does not wait for the stream to end.
Expand Down

0 comments on commit 997d922

Please sign in to comment.