I am trying to create a platform for clients to run their Runnable objects at a specified rate endlessly. I have the following code:
public class Health
{
public Health(Runnable r, int rate)
{
// I want to fork a new thread and then run the Runnable at the
// specified rate. How ??
}
}
Clients would create a bean of Health with their own Runnable and rate. How can I accomplish this.