You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This should make handling stream errors possible from the SDK's
Need a good way to pass a Result<> through the FFI boundary for uniffi & napi. This could either be by using the traditional Result type or crafting some custom type for XMTP Stream errors.
the with_callback variant is just the non-with-callback variant, except they take a callback and iterate on the stream in a spawned tokio task. This makes it more ergonomic for native client sdks to use the stream, since these native SDK's have no notion of a rust Stream type.
Notice, that in the with_callback variants, instead of passing the error into the callback, we instead match on the result and log an error. This makes it difficult/impossible for external SDKs to handle stream errors. we need a way to pass the error into the callback that is compatible with uniffi and napi
these bindings are in bindings_node/ and bindings_ffi/ folders respectively.
This will allow external native SDK's to handle stream errors rather than silently failing if an error occurs in a stream.
The text was updated successfully, but these errors were encountered:
This should make handling stream errors possible from the SDK's
Need a good way to pass a
Result<>
through the FFI boundary for uniffi & napi. This could either be by using the traditionalResult
type or crafting some custom type for XMTP Stream errors.the fn signatures in question:
pub async fn stream_conversations
pub(crate) async fn stream_messages
pub async fn stream_all_messages
pub fn stream_conversations_with_callback
pub(crate) fn stream_messages_with_callback
pub fn stream_all_messages_with_callback
the
with_callback
variant is just the non-with-callback
variant, except they take a callback and iterate on the stream in a spawnedtokio
task. This makes it more ergonomic for native client sdks to use the stream, since these native SDK's have no notion of a rustStream
type.Notice, that in the
with_callback
variants, instead of passing the error into the callback, we instead match on the result and log an error. This makes it difficult/impossible for external SDKs to handle stream errors. we need a way to pass the error into the callback that is compatible withuniffi
andnapi
these bindings are in
bindings_node/
andbindings_ffi
/ folders respectively.This will allow external native SDK's to handle stream errors rather than silently failing if an error occurs in a stream.
The text was updated successfully, but these errors were encountered: