From mboxrd@z Thu Jan 1 00:00:00 1970 From: wmorgan-sup@masanjin.net (William Morgan) Date: Tue, 11 Sep 2007 13:48:55 -0700 Subject: [sup-talk] on sup In-Reply-To: <1189060693-sup-3576@tatooine> References: <1188557360-sup-7369@bryma> <1188573751-sup-6067@south> <20070831171234.GD8312@die.therning.org> <1188773706-sup-1502@south> <1188977552-sup-60@tatooine> <1189029109-sup-7643@south> <1189060693-sup-3576@tatooine> Message-ID: <1189543040-sup-8299@south> 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