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

Callbacks not working? #2

Open
innsternet opened this issue Jun 27, 2019 · 1 comment
Open

Callbacks not working? #2

innsternet opened this issue Jun 27, 2019 · 1 comment

Comments

@innsternet
Copy link

innsternet commented Jun 27, 2019

Hello guys,

I know this library hasn't been updated in a while but it seems to be working somewhat, I am having a problem receiving the callback from the ticker though... It only seems to receive the very first callback then nothing after that.

Here's some test code:
`
coinfloor.connect(URI.create("wss://api.coinfloor.co.uk/"));

		Callback<Coinfloor.TickerInfo> callback = new Callback<Coinfloor.TickerInfo>() {

			public void operationCompleted(TickerInfo result) {
				System.out.println(result.toString());
			}

			public void operationFailed(Exception exception) {
				System.out.println("failed");
				
			}
			
		};
		
		coinfloor.watchTickerAsync(XBT, GBP, true, callback);

	`

As I would expect everytime the websocket pings out the updated ticker info the operationCompleted would print out the new ticker info but it doesn't it only prints the very first one then nothing after?

Maybe I am being stupid and missing something (probably likely) any ideas?

Thanks

@whitslack
Copy link

That callback is only to receive the reply to the WatchTicker command. You need to subclass the Coinfloor class and override the tickerChanged method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants