Giter VIP home page Giter VIP logo

Comments (6)

cowwoc avatar cowwoc commented on August 15, 2024

Correction: the JVM shuts down about a minute later, but I'd like to shut it down sooner (explicitly). Is there a method for that?

from binance-java-api.

joaopsilva avatar joaopsilva commented on August 15, 2024

Is that the only code you're running? It should shut down by itself immediately after the call. Otherwise, you can always call System.exit(0) to force the termination o the JVM.

from binance-java-api.

cowwoc avatar cowwoc commented on August 15, 2024

It should shut down by itself immediately, but does not. Did you try reproducing this on your end?

I don't consider System.exit() an option because the idea is to shut down once all threads become idle. Today I've got a very simple program, but tomorrow I might want to wait for other threads (other than this API) to shut down and I won't know when it's safe to invoke System.exit().

from binance-java-api.

joaopsilva avatar joaopsilva commented on August 15, 2024

Hi @cowwoc , I tried to reproduce the issue but I was unable to. From which context are you running the code above? A regular main entrypoint? Also, are you sure you're using the sync version of the API, not the async?

from binance-java-api.

cowwoc avatar cowwoc commented on August 15, 2024

@joaopsilva Correct, my entire class file is as follows:

public final class Test
{
	private static final String API_KEY = "value-goes-here";
	private static final String API_SECRET = "value-goes-here";

	public static void main(String[] args) throws IOException
	{
		BinanceApiClientFactory factory = BinanceApiClientFactory.newInstance(API_KEY, API_SECRET);
		BinanceApiRestClient client = factory.newRestClient();
		TickerStatistics price = client.get24HrPriceStatistics("BTCUSDT");
		System.out.println("Price: " + price.getLastPrice());
        }
}

I see Price printing out, then the console sits there for another minute or so. Then it eventually quits. This is running against the master branch of this repository.

from binance-java-api.

VjekoslavKrainovic avatar VjekoslavKrainovic commented on August 15, 2024

What is fix? I also have same problem.

from binance-java-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.