• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

eternal process

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to create an eternal process (thread?) that will run on the server and will scan a database to see if certain things should be done. this process should be in a pretty low priority.

any ideas/links about what I should do to implement this?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the Timer class in the library to run a task at scheduled times. Timer is a normal Java thread with a loop in the run() method and it can be set to never end. It would be nice to have a clean way to terminate it. Ctrl-C works, but a UI or a remote interface - eg a socket protocol - would be better.

I have no idea what your skills are. Does this sound fun or a bit daunting or like I'm not speaking English? Don't be afraid to ask for more detail. If you haven't used Timer before, try to make something that just says "Hello" every 20 seconds and see how it all works.
 
reply
    Bookmark Topic Watch Topic
  • New Topic