public bool SaveAnswer(PollUserAnswer answer)
        {
            bool ret = false;

            QuestionWorker worker = new QuestionWorker();
            ret = worker.SaveAnswer(answer);

            return ret;
        }
Example #2
0
        public bool SaveAnswer(PollUserAnswer answer)
        {
            bool ret = false;

            string pubnubChannel = answer.QuestionID;
            mrePublish.AddOrUpdate(pubnubChannel, new ManualResetEvent(false), (key, oldState) => new ManualResetEvent(false));
            messagePublished[pubnubChannel] = false;

            pubnub.Publish<string>(pubnubChannel, answer.UserAnswer, PollUserAnswerPublishRegularCallback, PollUserAnswerPublishErrorCallback);
            mrePublish[pubnubChannel].WaitOne(TimeSpan.FromSeconds(10));

            if (messagePublished[pubnubChannel])
            {
                ret = true;
            }

            return ret;
        }