Exemple #1
0
        /**
         * Matches up the incoming PutRecordResult to an outstanding future, and
         * completes that future with the appropriate data.
         *
         * <p>
         * We adapt the protobuf PutRecordResult to another simpler
         * PutRecordResult class to hide the protobuf stuff from the user.
         *
         * @param msg
         */
        private void onPutRecordResult(Message msg)
        {
            TaskCompletionSource <KPLDotNetResult> f = getFuture(msg);
            UserRecordResult result = UserRecordResult.fromProtobufMessage(msg.PutRecordResult);

            if (result.isSuccessful())
            {
                f.SetResult(new KPLDotNetResult()
                {
                    KPLResultType = KPLDotNetResultType.UserRecordResult, UserResult = result
                });
            }
            else
            {
                f.SetException(new UserRecordFailedException(result));
            }
        }
Exemple #2
0
 public UserRecordFailedException(UserRecordResult result)
 {
     this.result = result;
 }