A queue, a queue!



Hi there,

I finished the TnyQueue and TnyQueueTask redesign and I have adapted the
existing queues in libtinymail-queues to this.

What has changed:
 * AsyncWorker is now optional for libtinymail-queues
    * IF you implement your own TnyQueue and TnyQueueTask

 * libtinymail-asyncworker implements a TnyQueue with AsyncWorker

 * libtinymail-queues's types decorate a TnyQueue (any)
    * This way you can share one mother queue with multiple
      queue disciplines (multiple queued functionalities)

What also has changed:

* I created some beginnings of documentation

   http://tinymail.org/trac/tinymail/wiki/TnyQueueAndTnyQueueTask
   http://tinymail.org/trac/tinymail/wiki/TnyQueue
   http://tinymail.org/trac/tinymail/wiki/TnyQueueTask
   http://tinymail.org/trac/tinymail/wiki/AsyncWorker
   http://tinymail.org/trac/tinymail/wiki/TnyAsyncWorkerQueue
   http://tinymail.org/trac/tinymail/wiki/TnyAsyncWorkerQueueTask

* Please do enhance these

What needs to be done:

 * More queue types in libtinymail-queues
   * TnyGetMsgQueue for getting messages
   * TnyGenericSendQueue for sending messages

 * The improvements that Sergio needs for TnyGetMsgQueue
    * Maybe this implies an API change to TnyQueue (which is fine. just
      tell me, or let's check whether everything we want to do is or
      isn't possible right now)

 * Split TnyGetMsgQueue into two queue disciplines:
   * TnyGetFullMsgQueue
     * For bulk getting all messages of a folder

   * TnyGetMsgQueueAndAct 
     * For getting a message and displaying it

It would work like this:


TnyQueue *mother = create_mother_queue ();

TnyGetFullMsgQueue *fmsgq = new TnyGetFullMsgQueue (mother);
TnyGetMsgQueueAndAct *gmsgaq = new TnyGetMsgQueueAndAct (mother);


on_show_message (header, view)
{
  gmsgaq.show_soon (header, view)
}

on_get_all_messages (folder)
{
  fmsgq.get_all (folder)
}


Both queues will share "mother" as their one-queue-to-rule-them-all
queue. Although the TnyGetMsgQueueAndAct will obviously give a ultra
high priority to the task, it wont disallow the TnyGetFullMsgQueue to
keep fetching full messages in the background.

Is this working already: in theory, yes. In practise, I can imagine that
this still needs a lot of work.

Please look at the design and the existing documentation (and maybe at
the code too), and let me know what you think (on the mailing list).


-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]