These are chat archives for NimbusAPI/Nimbus

17th
Feb 2016
Ashley Mannix
@KodrAus
Feb 17 2016 03:35
I've done something like this in the past for routing, but put responsibility for computing the hash on the message class instead of the dispatcher. That would reduce duplicating what defines your equality key:
interface IMessageWithKey
{
    Guid GetKey();
}

class MyMessage : IMessageWithKey
{
    public int Prop1 { get; set; }
    public string Prop2 { get; set; }

    public Guid GetKey()
    {
        return Hash(Prop1.ToString() + Prop2);
    }
}
johnknoop
@johnknoop
Feb 17 2016 07:53
(Y)
:thumbsup: