How to implement a messaging system?

Chris Muller asqueaker at gmail.com
Mon Jan 3 01:30:19 UTC 2011


> However, since each session has its own view of this object, any other user/session dropping a message into the Collection would violate the rule 'do not share objects between MagmaSession instances'.

Hi Amir, this does not have any bearing on the design of a messaging
system.  I don't understand what you mean, why you say:

"any other user/session dropping a message into the Collection would
violate the rule 'do not share objects between MagmaSession
instances'."

?

Because for user A and user B, each accessing the one persistent model
via Session A and Session B, respectively, A would add Message-A to
B's 'collection' which he accessed from his session.  After B
refreshed his session, his view of the model would reflect his own
copy of Message-A in his own copy of B's 'collection'.

> What is the proper way to implement such a system?  I'd be very grateful for any insight!

What you said should work just fine.  Use MagmaCollections with an
index on the timestamp so you don't have to worry about
commit-conflicts.

 - Chris


On Sun, Jan 2, 2011 at 3:58 PM, Amir Ansari <fractallyte at csi.com> wrote:
> Dear list
>
> (I guess this follows on from my previous posts...)
>
> I'm trying to set up a simple messaging system using Magma, to enable users to pass messages to one another.  I considered creating a 'mailbox' Collection for each user, in which messages could be stored, and which could be polled at regular intervals to check for new messages.
>
> However, since each session has its own view of this object, any other user/session dropping a message into the Collection would violate the rule 'do not share objects between MagmaSession instances'.
>
> What is the proper way to implement such a system?  I'd be very grateful for any insight!
>
> Amir
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>


More information about the Magma mailing list