MongooseWhere programmers kick back and build silly things together.

All help topics · Link to this topic

Showing help on '$big_mail_recipient'

Generic Large Capacity Mail Recipient


Since any modifications to large lists entail copying the entire list over, operations on ordinary mail recipients having large numbers of messages, that actually change the content of .messages will take inordinately long. Thus we have this version which makes use of the $biglist package, scattering the messages onto numerous properties so that write operations involving only a few messages will not require recopying of the entire list.

In nearly all respects it behaves as the ordinary Mail Recipient, except that it is faster for certain kinds of operations.

Certain unimplemented verbs, like :date_sort(), and :messages() currently return E_VERBNF.

To convert an existing $mail_recipient-child (call it #MR) into a $big_mail_recipient-child the basic procedure is

;;something.foo= #MR:messages();
@rmm 1-$ from #MR
@unrmm expunge
@chparent #MR to $big_mail_recipient
;#MR:receive_batch(@something.foo);

Reconstructing Damaged Big Mail Recipients


On rare occasions, the tree structure created by $biglist can be corrupted (this can happen on lists sufficiently large that a list-modification operation (e.g., @rmm, @renumber) runs out of ticks/seconds). In the vast majority of such cases, your messages are all still there; it's simply that the tree we use for finding/searching them is messed up.

To recover messages from a damaged big mail recipient (#DBMR)
- -- read to the end before you start typing any commands ---

create a fresh $big_mail_recipient (#NEWBMR) and then do the following:

;#NEWBMR:restore_from(#DBMR)

When this finishes, #NEWBMR will contain all of the mail messages we were able to find. (note that this will include messages that you had deleted from #DBMR but not expunged). #NEWMBR should thenceforth be useable in place of #DBMR, however if #DBMR contains custom verbs and non-clear properties, these will also need to be copied over.

Alternatively, one may do

@copyobject #DBMR to #TEMPBMR
;#DBMR:restore_from(#TEMPBMR)

to rebuild #DBMR in place. This, however, will take about twice as long.

oooooooooooooooooooooooooooooooo
WARNING!!! WARNING!!! WARNING!!!
oooooooooooooooooooooooooooooooo

Calling #OBJ:restore_from(...) COMPLETELY AND IRREVOCABLY REMOVES ALL MESSAGES from the object that it is run on (#OBJ); you MUST be sure to EITHER have made a copy of #OBJ OR be doing the restore to a DIFFERENT object.