This repository was archived by the owner on Apr 6, 2019. It is now read-only.
Add implementation for the CLIENT KILL command #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to propose an implementation of the CLIENT KILL command
This solution handles all syntax written in the document, the first one using CLIENT KILL IP: port, and the other one using filters, we use type for deducing which one we need to call for handling compatibility with the server on < 2.8.12 version.
If we have only an address, a port, and an optional lamba, we choose the CLIENT KILL IP: port, if we have at least one filter we choose the second one.
Lot of prototypes are implemented, but two are important, the first one with only a variadic template for filters, and the other one with
std::string host, int port, ...
prototype.Lot of stuffs are handled in the compile time, for example the solution launch a static_assert if the lambda is not the last argument when we call the function member for keeping a sense with the other function member of the API. Also, if we call the function member using only a lambda, etc...
Also the implementation is create in an another file, because we use template, we don't really want to polluate the header file.
If we send a
bool
, we check theSKIPME
optionif we send an integral, it's the client ID.
if we send a
client_kill::type
who has several value likenormal
,master
,pubsub
andslave
correspond to the type of the client.Here an example of utilisation of
client_kill