Function tensor_trade_stream::subscribe
source · pub async fn subscribe<T: GraphQLQuery + Send + Sync + Unpin + 'static>(
variables: T::Variables
) -> Result<(AsyncWebsocketClient<GraphQLClient, Message>, SubscriptionStream<GraphQLClient, StreamingOperation<T>>)>where
<T as GraphQLQuery>::Variables: Send + Sync + Unpin,
<T as GraphQLQuery>::ResponseData: Debug,Examples found in repository?
examples/tensorswap_order_update_all.rs (line 11)
9 10 11 12 13 14 15 16 17 18 19 20 21
async fn main() -> Result<()> {
let (_client, mut stream) =
subscribe::<TensorswapOrderUpdateAllQuery>(TensorswapOrderUpdateAllVariables {}).await?;
while let Some(event) = stream.next().await {
let data = event?.data;
let response: TensorswapOrderUpdateAllResponse =
data.unwrap().tswap_order_update_all.unwrap();
dbg!(&response);
}
Ok(())
}