Beispiel #1
0
        public async Task <Tuple <InterpreterCondition, string> > Execute(string code, string userName)
        {
            if (code == null)
            {
                throw new ServiceException("code is null");
            }
            if (code.Length > 10000)
            {
                throw new ValidationException("Code's max length is 10000 symbols.");
            }
            var context = ExecuteContextPool.GetUserContext(userName);

            return(await context.Execute(code));
        }
Beispiel #2
0
        public async Task <Tuple <InterpreterCondition, string> > Continue(string input, string userName)
        {
            if (input == null)
            {
                throw new ServiceException("input is null");
            }
            if (input.Length > 100)
            {
                throw new ValidationException("input's max length is 100 symbols.");
            }
            var context = ExecuteContextPool.GetUserContext(userName);

            return(await context.Continue(input));
        }
Beispiel #3
0
 public void ClearOverTheLast(int seconds)
 {
     ExecuteContextPool.ClearOverTheLast(seconds);
 }
Beispiel #4
0
        public Tuple <InterpreterCondition, string> Stop(string userName)
        {
            var context = ExecuteContextPool.GetUserContext(userName);

            return(context.Stop());
        }
Beispiel #5
0
        public Tuple <InterpreterCondition, string> Stop(int guestId)
        {
            var context = ExecuteContextPool.GetGuestContext(guestId);

            return(context.Stop());
        }