using Java
I have done some research before asking here but I was still unable to find an answer. I am writing an application that connects to twitter’s streaming api and receives some tweets. I intend to run the program for a few hours and then I need to interrupt it.
There is no multi-threading so far in my project and I am trying to avoid that. If I make the function that gets the tweet synchronized, would it complete even if I closed the program while it’s executing?
If there is no multi-threading in your application, why do you need
synchronized? Never mind, your application will complete. Hitting Ctrl+C will just interrupt all threads and shutdown nicely.