Created
May 11, 2010 03:05
-
-
Save garethstokes/396872 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public RiakResponse<string[]> ListKeysFor(ListKeysRequest request) { | |
var connection = _connectionManager.GetNextConnection(); | |
var writeResponse = connection.WriteWith(requestObject: request, | |
method: RequestMethod.ListKeys); | |
return writeResponse.ResponseCode == RiakResponseCode.Failed | |
? RiakResponse<string[]>.WithErrors(writeResponse.Messages) | |
: RiakResponse<string[]>.ReadResponse(() => { | |
var readResponse = connection.Read<ListBucketsResponse>(); | |
return readResponse.ResponseCode == RiakResponseCode.Failed | |
? RiakResponse<string[]>.WithErrors(readResponse.Messages) | |
: RiakResponse<string[]>.WithoutErrors(readResponse.Result | |
.Buckets | |
.Select(x => x.DecodeToString()) | |
.ToArray()); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment