ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 58 forks source link

Unable to implement a websub usecase #1155

Closed hemikak closed 3 years ago

hemikak commented 3 years ago

Description: I am trying to implement a websub use case but not able to get it done. I have tried using https://github.com/ballerina-platform/ballerina-distribution/blob/master/examples/websub-hub-client-sample/subscriber_service.bal , but I am not able to build it because of the following errors:

PS C:\Users\hemik\github\bifinance-trading-bot> bal build

Compiling source
        hemik/bifinance_trade_bot:0.1.0
ERROR [main.bal:(18:36,18:55)] unknown type 'Notification'
ERROR [main.bal:(21:13,21:66)] undefined function 'print'
ERROR [main.bal:(21:13,21:66)] undefined module 'log'
ERROR [main.bal:(23:13,24:49)] undefined function 'printError'
ERROR [main.bal:(23:13,24:49)] undefined module 'log'
error: compilation contains errors

It seems the BBEs are also missing: Screenshot 2021-03-23 195938

Describe your problem(s) Attempting to implement for https://docs.binance.org/api-reference/dex-api/ws-connection.html

Describe your solution(s)

Related Issues (optional):

Suggested Labels (optional):

Suggested Assignees (optional):

gimantha commented 3 years ago

@hemikak I think you have to refer to websockets not websub.

hemikak commented 3 years ago

@gimantha , I may have been wrong. But I was planning to subscribe to a websocket so that I dont have loop and get the data all the time. See "Method 2: Subscribe to streams on demand" section .

ayeshLK commented 3 years ago

@hemikak we have done an API upgrade for websub module. You could refer to following BBE on updated implementation.

ayeshLK commented 3 years ago

This issue is not relevant to latest websub framework. Hence closing the issue.

praneesha commented 3 years ago

Closing as per the above comment.