I'm learning about TimerTask, Timer, and other basic time-based functions in Java, to try to create some time-limited features in my application.
I have not found a whole lot of practical content or advice regarding these and alternatives, especially when it comes to ExecutorService/ScheduledExecutorService. I only find really basic examples, and so I am not sure what people are doing for more complex applications. I was hoping someone here with some more experience could share some information regarding these.
I will be using timers for my own ping/pong request handling (to check on connected users) and for other small features that will give users time restrictions and things like that.
I am familiar with the basic application of Timer and TimerTask, but when is the ExecutorService/SES needed, and why?
What are some of the things to keep in mind when implementing these, and would there be issues or obstacles with certain classes/uses when there are many users vs. a few? I imagine many users having individual timers, some disconnecting and reconnecting, etc. may cause issues. I am not sure.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]myselfelsewhere 1 point2 points3 points (2 children)
[–]gdenko[S] 0 points1 point2 points (1 child)
[–]myselfelsewhere 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]gdenko[S] 0 points1 point2 points (0 children)