Send & subscribe and subscribe transaction data providers should be implemented as part of the new WebSocket pub/sub system based on the [Draft design of new WebSockets] (https://github.com/onflow/flow-go/issues/6508).
Requirements:
Send & subscribe and subscribe transaction data providers constructors should be implemented. The constructors should create a corresponding subscription.Subscription based on input arguments, and store topic, subscription and other necessary parameters in a newly created instance. These constructors should be called in a DataProviderFactory::NewDataProvider method.
Run should be implemented. It will start in a forever loop until the subscription is closed. This method collects streaming data from the subscription, similar to how we do it, for example in SendAndSubscribeTransactionStatuses:
Send & subscribe and subscribe transaction data providers should be implemented as part of the new WebSocket pub/sub system based on the [Draft design of new WebSockets] (https://github.com/onflow/flow-go/issues/6508).
Requirements:
Send & subscribe and subscribe transaction data providers constructors should be implemented. The constructors should create a corresponding
subscription.Subscription
based on input arguments, and storetopic
,subscription
and other necessary parameters in a newly created instance. These constructors should be called in aDataProviderFactory::NewDataProvider
method.Run
should be implemented. It will start in a forever loop until the subscription is closed. This method collects streaming data from the subscription, similar to how we do it, for example inSendAndSubscribeTransactionStatuses
:https://github.com/onflow/flow-go/blob/3496c0f02d51602994d4fe60b32fcb00aab084f4/access/handler.go#L1407-L1451
Then the data is formatted in response messages for the client and written to the
send
callback.Also,
MessageIndex
should be included in the response.The
Close
method should be implemented to shut down the subscription gracefully.ID
andTopic
getters should returnUUID
and the topic respectively.