Ejemplo n.º 1
0
        /// <summary>
        /// Do not use, still have potencial thread conflict issue, may cause application crash
        /// </summary>
        /// <param name="functionName"></param>
        /// <param name="JSONparameter"></param>
        /// <returns></returns>
        public Task <string> DispatchAsync(string functionName, string JSONparameter)
        {
            //
            var t = Task.Factory.StartNew(() =>
            {
                var x = Reference.CallFunctionAsync <string, string, string>("DispatchAsync", functionName, JSONparameter);
                x.Wait(); //force wait on caller thread, otherwise may cause chakracontext thread confilict
                return(x.Result);
            });

            return(t);
        }