예제 #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));
        }
예제 #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));
        }
예제 #3
0
 public void ClearOverTheLast(int seconds)
 {
     ExecuteContextPool.ClearOverTheLast(seconds);
 }
예제 #4
0
        public Tuple <InterpreterCondition, string> Stop(string userName)
        {
            var context = ExecuteContextPool.GetUserContext(userName);

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

            return(context.Stop());
        }