Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Access] Implement DataProvider interface and factory of data providers #6584

Open
Tracked by #6163
Guitarheroua opened this issue Oct 22, 2024 · 0 comments · May be fixed by #6636
Open
Tracked by #6163

[Access] Implement DataProvider interface and factory of data providers #6584

Guitarheroua opened this issue Oct 22, 2024 · 0 comments · May be fixed by #6636
Assignees
Labels

Comments

@Guitarheroua
Copy link
Contributor

Guitarheroua commented Oct 22, 2024

SubscriptionHandler Implementation

Based on the Draft design of new WebSockets, a new SubscriptionHandler interface should be implemented as part of the new WebSocket subscription system, building on the current WebSocketController. All requirements and relationships between components are described in the draft design document.

The SubscriptionHandler interface abstracts the actual subscriptions managed by the WebSocketBroker. Concrete SubscriptionHandler implementations will be created during the WebSocketBroker::subscribe call, depending on the topic provided by the client. For example, the topic events will have an EventsSubscriptionHandler implementation to manage event subscriptions.

The supported topics include:

  • events
  • account_statuses
  • blocks
  • block_headers
  • block_digests
  • transaction_statuses

All concrete handlers will be implemented in separate tasks, based on this interface.

This issue includes implementing the interface and a factory method:

type SubscriptionHandler interface {
    Close() error
}

func CreateSubscriptionHandler(topic string, arguments map[string]interface{}, broadcastMessage func([]byte) error) (SubscriptionHandler, error)

If possible, a basic implementation of the SubscriptionHandler interface should be provided, which will include common functionality for each concrete handler. This can be done after some of the handlers have already been implemented.

@Guitarheroua Guitarheroua changed the title [Access] Implement SubscriptionHandler interface [Access] Implement SubscriptionHandler interface Oct 22, 2024
@Guitarheroua Guitarheroua changed the title [Access] Implement SubscriptionHandler interface [Access] Implement SubscriptionHandler interface and CreateSubscriptionHandler factory method Oct 23, 2024
@Guitarheroua Guitarheroua self-assigned this Oct 24, 2024
@Guitarheroua Guitarheroua changed the title [Access] Implement SubscriptionHandler interface and CreateSubscriptionHandler factory method [Access] Implement SubscriptionHandler interface and CreateSubscriptionHandler factory Oct 24, 2024
@Guitarheroua Guitarheroua removed their assignment Nov 8, 2024
@Guitarheroua Guitarheroua changed the title [Access] Implement SubscriptionHandler interface and CreateSubscriptionHandler factory [Access] Implement DataProvider interface and factory of data providers Nov 12, 2024
@UlyanaAndrukhiv UlyanaAndrukhiv linked a pull request Nov 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants