Accumulator refactor:

Stores a single copy of each request from different sources.
Firewalls identical requests.
Implements time based eviction policy.
Tests.
please forget last email :) I misunderstood something

On Thu, Dec 18, 2014 at 1:35 PM, M Moadeli <mmoadeli@maidsafe.net> wrote:
>
> 1- Vault is used on system with different configurations. Most of those
> parameters ideally should be related to the system specs. Declaring them
> const won't allow any change.
>
> 2- I still think having the value in parameters is a better option.
>
> On Thu, Dec 18, 2014 at 1:23 PM, BSMaidSafe <notifications@github.com>
> wrote:
>>
>> In src/maidsafe/vault/tests/accumulator_test.cc
>> <https://github.com/maidsafe/MaidSafe-Vault/pull/92#discussion-diff-22040969>
>> :
>>
>> > +
>> > +  routing::GroupId group_id2(NodeId(crypto::SHA512Hash(RandomString(64))));
>> > +  routing::SingleId sender_id20(NodeId(crypto::SHA512Hash(RandomString(64))));
>> > +
>> > +  routing::GroupSource group_source10(group_id1, sender_id10),
>> > +                       group_source11(group_id1, sender_id11),
>> > +                       group_source12(group_id1, sender_id12);
>> > +
>> > +  routing::GroupSource group_source20(group_id2, sender_id20);
>> > +
>> > +  EXPECT_EQ(Accumulator<PmidNodeServiceMessages>::AddResult::kWaiting,
>> > +            accumulator.AddPendingRequest(message, group_source10, checker));
>> > +  EXPECT_EQ(Accumulator<PmidNodeServiceMessages>::AddResult::kWaiting,
>> > +            accumulator.AddPendingRequest(message, group_source11, checker));
>> > +
>> > +  Sleep(std::chrono::seconds(1));
>>
>> Like I said above the accumulator acquired a constructor with a default
>> lifetime. After a bit of discussion about it Mahmoud suggested using the
>> Parameters struct. The problem is if we make it a constant we can't test it
>> on short lifetimes and as you noticed below if it gets changed it probably
>> needs reset. So I was thinking about changing it back to an argument with a
>> default value in the Accumulator constructor, are there any objections to
>> that?
>>
>> —
>> Reply to this email directly or view it on GitHub
>> <https://github.com/maidsafe/MaidSafe-Vault/pull/92/files#r22040969>.
>>
>
>
> --
> Regards,
> Mahmoud
>
> maidsafe.net Limited is a limited liability company incorporated in
> Scotland with number SC297540. VAT Registered 889 0608 77. Registered
> Office: 72 Templehill, Troon, KA10 6BE.
> Telephone Scotland: +44 1292 750020.
>


-- 
Regards,
Mahmoud

maidsafe.net Limited is a limited liability company incorporated in
Scotland with number SC297540. VAT Registered 889 0608 77. Registered
Office: 72 Templehill, Troon, KA10 6BE.
Telephone Scotland: +44 1292 750020.