This file contains an adhoc list of items that need doing within the
codebase.  Please keep the date of comments for historical purposes.

Tasks
============================================================================

1.    Make GTask ref-counted so that we may properly free the task.

      2008-10-05 -- Christian Hergert

      -- Completed: Inherits GObject

      2008-10-14 -- Christian Hergert

2.    Look into if we need to have a GDestroyNotify for the GTask.  This
      may be desired if the state is private to the task.  However,
      should this not be done in a Callback or a chained Task?

      2008-10-05 -- Christian Hergert

      -- Completed: Merged GTaskQueue and GTaskScheduler, no longer needed

      2008-10-14 -- Christian Hergert

3.    We need to have a system for getting a callback when something
      has happened on a set of tasks.  For example, if we want a
      callback if either of 2 tasks complete.

      task1 \____ task/callback
      task2 /

      I can immediately think of a couple options:

          * Any of tasks finished
	  * Either of tasks finished

      These should be able to be chained as well too.  That way you
      can have (any of these 5 tasks) + (either of these 2) => callback.

4.    Currently, a task has to block while it finishes work.  We should
      very much work to support in the near future concurrent tasks
      that immediately return.  For example, using gio for a read
      asynchronously and finish the task on completion.

      -- Completed: See g_task_new_with_async().

      2008-10-16 -- Christian Hergert

5.    Vala bindings could use some love so that we can do chaining of
      callbacks easier.  It would be nice if you could create a task
      and assign callbacks and errbacks in one assignment.  Such as:

      var task = new Task (this.worker).add_callback (_ => {
          debug ("callback");
      }).add_errback (_ => {
          debug ("errback");
      }).add_callback (_ => {
          debug ("another callback");
          this.progress_bar.pulse ();
      });

      TaskScheduler.get_default ().schedule (task);

6.    Python Bindings need to be created.

7.    GScript Bindings need to be created.

8.    GObject Introspection files need to be created.  Both the GIR
      description file and the compiled typelib.

9.    Wrapping the GTaskFunc may prove difficult in various languages
      due to the out params for the task.  We should consider moving
      this to get/set/unset methods so that we can remove it from the
      GTaskFunc prototype.

      This would allow for callbacks to do something like such (in Vala):

      var task = new Task (this.worker).add_callback (task => {
          if (true) task.set_error (new Random.ERROR ());
      });

      However, if vala supported throwing errors in delegates, we could
      have the callback just throw an error and catch it in the callback.
      Not sure on that though, since unset'ing the error would prove
      difficult.

10.   We need more examples.  A gtk+ example would be nice to have.  It
      should do a fair amount of processing work in the background and
      update the ui accordingly.  And of course, it should be trivial
      to make this happen smoothly.

11.   Once GObject DataMapper is upgraded to use GTask, we should
      provide an example of integrating the two.

12.   It would be nice to have an example of how to process a task and its
      children synchronously if desired.  It's not really ideal, I know, since
      dependent tasks could cause never ending tasks.

13.   Pull thread management outside of GTaskScheduler.  There really is no
      nead for schedulers to have to manage the number of threads they
      have and whatnot.  Its boring housekeeping that can be better done
      by a ThreadManager.  Schedulers should provide a "natural", "min",
      and "max" size.  Natural size is a suggested starting number of
      threads for the scheduler.  Min and Max are the number of min threads
      and max threads that should be assiged to the scheduler respectively.

      Doing this would allow schedulers to spend more time focusing on
      execution strategies rather than house-keeping.  For example, we have
      a web-server written in GTask.  To serve a particular request, an
      external resource may be required.  If we know the external resource
      is current overloaded, we may defer a request until that external
      resource may more readily serve our request.  A database may be a good
      example of this.  Also backend web services.
