Invoke() public method

public Invoke ( object>.IDictionary env ) : System.Threading.Tasks.Task
env object>.IDictionary
return System.Threading.Tasks.Task
Ejemplo n.º 1
0
        public Task Invoke(IDictionary <string, object> env)
        {
            var path = Get <string>(env, OwinConstants.RequestPath);

            if (path == null || !path.StartsWith(_path, StringComparison.OrdinalIgnoreCase))
            {
                return(_app.Invoke(env));
            }

            var pathBase   = Get <string>(env, OwinConstants.RequestPathBase);
            var dispatcher = new HubDispatcher(pathBase + _path);

            var handler = new CallHandler(_resolver.Invoke(), dispatcher);

            return(handler.Invoke(env));
        }
Ejemplo n.º 2
0
        public Task Invoke(IDictionary <string, object> env)
        {
            var path = Get <string>(env, OwinConstants.RequestPath);

            if (path == null || !path.StartsWith(_path, StringComparison.OrdinalIgnoreCase))
            {
                return(_app.Invoke(env));
            }

            var resolver          = _resolver.Invoke();
            var connectionFactory = new PersistentConnectionFactory(resolver);
            var connection        = connectionFactory.CreateInstance(_connectionType);

            var handler = new CallHandler(resolver, connection);

            return(handler.Invoke(env));
        }