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

Pages: 1-

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.

Name: Anonymous 2009-10-06 9:37

>>2
synchronizethis
*grabs dick*

Name: Anonymous 2009-10-06 9:58

The proper approach here is to have a global variable set to a sensible default, and let each thread rebind that variable in its dynamic environment.

Name: Anonymous 2009-10-06 11:22

Use a functor.

Name: Anonymous 2009-10-06 12:32

>>5
U MENA MONADD

Name: Anonymous 2011-02-04 18:05


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