Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: wmorgan-sup@masanjin.net (William Morgan)
Subject: [sup-talk] on sup
Date: Tue, 11 Sep 2007 13:48:55 -0700	[thread overview]
Message-ID: <1189543040-sup-8299@south> (raw)
In-Reply-To: <1189060693-sup-3576@tatooine>

Excerpts from Magnus Therning's message of Wed Sep 05 23:50:33 -0700 2007:
> I did look at the sup-sync-back tool and noticed that it performs some
> mbox operations on its own.  Operations that I feel really belong in
> the mbox source class itself.  I feel sup-sync-back would become
> simpler if polymorphism was put to use a bit more.  So, do you have
> any philosophical problems with a `delete` method being added to the
> sources?  (It would probably be followed by a `mark_as_read` in the
> future.)

I don't have a philosophical problem with that, certainly.  Sup-sync-
back was written in that way because I was fleshing out a lot half-baked
ideas about how things should work at the time, and it will definitely
be necessary to move that code to Mbox::loader before it can support
other source types.

In order to support batch operations, I think there should be two
methods per source, really: #delete and #write_deletes_to_disk (or
whatever), with the semantics that #delete may or may not do something
but you're guaranteed that deletions have happened after a call to
#write_deletes_to_disk. Then Maildir, IMAP, etc can delete immediately,
and mbox can defer (presumably building up an array of offset to be
deleted, and then doing the batch deletion as it does currently.)

(There are actually a couple other things that need to happen to
 mbox---it shouldn't keep the file pointers open all the time, it should
 wrap deletion and new message scanning with a call to dotlockfile, and
 the bizarre division of labor between loader, sshloader, and the source
 superclass has become a classic example of how not to use inheritance.
 Luckily, none of those things really affect this issue.)

What do you think?

-- 
William <wmorgan-sup at masanjin.net>


  reply	other threads:[~2007-09-11 20:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1188557360-sup-7369@bryma>
2007-08-31 15:31 ` William Morgan
2007-08-31 17:12   ` Magnus Therning
2007-09-02 23:03     ` William Morgan
2007-09-05  7:48       ` Magnus Therning
2007-09-05 15:27         ` William Morgan
2007-09-06  7:02           ` Magnus Therning
2007-09-11 22:08             ` William Morgan
2007-09-11 23:04               ` Magnus Therning
2007-09-05 21:55         ` William Morgan
2007-09-06  6:50           ` Magnus Therning
2007-09-11 20:48             ` William Morgan [this message]
2007-09-03 12:33     ` [sup-talk] saving sent mail to places other than the default jeff covey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1189543040-sup-8299@south \
    --to=wmorgan-sup@masanjin.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox