Skip to content

How to define type when use redis adapter #558

Answered by Totodore
supaatwi asked this question in Q&A
Discussion options

You must be logged in to vote

Currently, your only solution is to make AppState generic over the adapter:

struct AppState<A> {
    pub io: SocketIo<A>,
}

Indeed the Emitter type is not exported and it should be so you can specify a complete type.
By the way, you don't need to put SocketIo behind an Arc it is already one.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by supaatwi
Comment options

You must be logged in to vote
1 reply
@Totodore
Comment options

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