Skip to content

Trying to use kameo with tokio-tungstentie #66

Answered by tqwewe
bananasov asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @bananasov, thanks for asking this! The errors returned are definitely quite obscure.

Essentially, in order to meet the requirements of attach_stream, your actor needs to implement Message<StreamMessage<T, S, F>>. StreamMessage is a type provided by kameo, and is essentially just a wrapper type around the stream items. S and F can be any type you want for sending through context when the stream starts and finishes.

Looking into the Stream impl of WebSocketStream, the Item type is Result<Message, Error>, which indicates your actor should have the following impl block:

use kameo::message::{Context, Message, StreamMessage};

impl
    Message<
        StreamMessage<
            Result<tung…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@bananasov
Comment options

@tqwewe
Comment options

Answer selected by tqwewe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants