Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Directing feedback

Name: Anonymous 2009-10-06 8:46

So I'm writing a program to do some media conversion. As the media is being processed, I want the subroutines to report back how far along the processes is, any warnings encountered, and of course any errors that occur.

Since the program can be used with a gui or command-line, I want that feedback pipe interchangeable. But what is the best to implement that?

Should I pass a 'feedback object' to all subroutines that need to provide feedback? This would be a hassle, but would allow for multi-threaded tasks.

Or should there be a global singleton-type object that all subroutines can statically access. All feedback is piped to whatever global feedback object is registered. This would be easier, but removes the option for multi-threaded feedback pipes.

Any thoughts /prog/?

Name: Anonymous 2009-10-06 8:54

synchronize(this){
   //provide feedback to class method
}

there. nice and simple, yet still allows multi threading.
this is java btw. i don't know how to help if you're using python or sepples or whatever.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List