sociomantic-tsunami / dlsproto

Distributed Log Store protocol definition, client, fake node, and tests
Boost Software License 1.0
3 stars 18 forks source link

Add helper method makeGroupRequest #70

Closed nemanja-boric-sociomantic closed 6 years ago

nemanja-boric-sociomantic commented 6 years ago

Since DMD 2.071.* the request structs are private for the client. This means that it's deprecated to refer the request struct when instantiating the GroupRequest template. As an alternative, makeGroupRequest function template that deducts the type of the GroupRequest from the instance parameter is added.

nemanja-boric-sociomantic commented 6 years ago

I'm not sure about the milestone. This should ideally go into v13.2.x and be released as a bug fix (as the v14.0.x doesn't compile when using GroupRequest and appropriate compiler).

nemanja-boric-sociomantic commented 6 years ago

Fails in D1 :disappointed:

./src/dlsproto/client/legacy/internal/helper/GroupRequest.d(117): Error: template dlsproto.client.DlsClient.DlsClient.getRange(Key) does not match any function template declaration
./src/dlsproto/client/legacy/internal/helper/GroupRequest.d(117): Error: template dlsproto.client.DlsClient.DlsClient.getRange(Key) cannot deduce template function from argument types !()(char[7LU],ulong,ulong,void*,void*)
./src/dlsproto/client/legacy/internal/helper/GroupRequest.d(119): Error: template dlsproto.client.legacy.internal.helper.GroupRequest.makeGroupRequest(Request) does not match any function template declaration
./src/dlsproto/client/legacy/internal/helper/GroupRequest.d(119): Error: template dlsproto.client.legacy.internal.helper.GroupRequest.makeGroupRequest(Request) cannot deduce template function from argument types !()(_error_)
nemanja-boric-sociomantic commented 6 years ago

Uh, it might be connected just with the unittest (hopefully).

gavin-norman-sociomantic commented 6 years ago

Since DMD 2.071.* the request structs are private for the client.

Wasn't there a PR that made them public?

nemanja-boric-sociomantic commented 6 years ago

Just the Neo ones.

nemanja-boric-sociomantic commented 6 years ago

But the dhtproto's one are public.

gavin-norman-sociomantic commented 6 years ago

Ahh. We could do the same to the legacy ones?

nemanja-boric-sociomantic commented 6 years ago

We could, but the factory function makes that not necessary. I think this is the only place where you need to address these structs by their name, so I think they should still be private, given this workaround.

don-clugston-sociomantic commented 6 years ago

LGTM

nemanja-boric-sociomantic commented 6 years ago

Added release notes.