Post
Topic
Board Announcements (Altcoins)
Re: NXT :: descendant of Bitcoin - Updated Information
by
verymuchso
on 20/02/2014, 10:03:41 UTC
JeanLuc:

I posted this a couple of days ago. I still look forward to your reply.

Currently there is no way for java clients to get notified of progress during startup (nxt.Nxt.init())

Ideally there would be a listener you could register or some sort of progress monitor. In eclipse you have the IProgressMonitor interface, such an interface would be perfect, i included a simplified example.

public interface IProgressMonitor {
  public void beginTask(String name, int totalWork);
  public void done();
  public void worked(int work);
}

The monitor would be provided by the user and is passed to the various startup methods. When reading the blockchain (for instance) you would call monitor.beginTask("Read blockchain", totalNumberOfBlocks) and then on each (or each 5th, 10th etc.) block read you call monitor.worked(numberOfBlocksRead). At the end you would call monitor.done().


A listener for log messages would be very nice to. I now remove the nxt.util.Logger class and replace with my own in order to display messages in the dialog that displays startup progress. Not a clean solution at all.

Thanks!