Esempio n. 1
0
        public async Task Run(Action Action)
        {
            await IsReady;

            Worker.PostMessage("MNData", Uint8Array.From(Action.Serialize()));
            var Message = Worker.GetMessage();
            await Worker.Run($"self.MN.RunAction()");

            await Message;
        }
Esempio n. 2
0
        public async Task <object> Run(Func <Task <object> > Func)
        {
            await IsReady;

            Worker.PostMessage("MNData", Uint8Array.From(Func.Serialize()));
            var Message = Worker.GetMessage();
            await Worker.Run($"self.MN.RunFunctionTaskResult()");

            var Result = (await Message).GetData <Uint8Array>().ToArray();

            if (Result.Length == 0)
            {
                throw new Exception("Error On Proccess");
            }
            return(Result.Deserialize <object>());
        }