Search in sources :

Example 1 with Http2Event

use of com.webpieces.http2engine.impl.shared.data.Http2Event in project webpieces by deanhiller.

the class Level5AStates method fireToStateMachine.

private CompletableFuture<Void> fireToStateMachine(Http2SendRecieve type, Stream stream, Http2Msg payload, boolean keepDelayedState) {
    Http2Event event = translate(type, payload);
    CompletableFuture<Void> future = stream.getLock().synchronizeD(() -> {
        fireToStatemachineImpl(stream, event);
        return checkForClosedState(stream, payload, keepDelayedState);
    }).thenApply(isReleased -> {
        release(isReleased, stream, payload);
        return null;
    });
    return future.handle((v, e) -> {
        if (e == null) {
            return CompletableFuture.completedFuture(v);
        } else {
            return translateException(stream, e);
        }
    }).thenCompose(Function.identity());
}
Also used : NoTransitionConnectionError(com.webpieces.http2engine.impl.shared.data.NoTransitionConnectionError) SENT_DATA_EOS(com.webpieces.http2engine.impl.shared.data.Http2Event.SENT_DATA_EOS) RECV_RST(com.webpieces.http2engine.impl.shared.data.Http2Event.RECV_RST) NoTransitionListener(org.webpieces.javasm.api.NoTransitionListener) RECV_DATA_EOS(com.webpieces.http2engine.impl.shared.data.Http2Event.RECV_DATA_EOS) CompletableFuture(java.util.concurrent.CompletableFuture) CancelReasonCode(com.webpieces.http2parser.api.dto.error.CancelReasonCode) NoTransitionStreamError(com.webpieces.http2engine.impl.shared.data.NoTransitionStreamError) Function(java.util.function.Function) Http2Msg(com.webpieces.http2parser.api.dto.lib.Http2Msg) RECV_HEADERS_EOS(com.webpieces.http2engine.impl.shared.data.Http2Event.RECV_HEADERS_EOS) Http2SendRecieve(com.webpieces.http2engine.impl.shared.data.Http2Event.Http2SendRecieve) StateMachineFactory(org.webpieces.javasm.api.StateMachineFactory) Http2Event(com.webpieces.http2engine.impl.shared.data.Http2Event) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Http2Headers(com.webpieces.hpack.api.dto.Http2Headers) Http2Push(com.webpieces.hpack.api.dto.Http2Push) State(org.webpieces.javasm.api.State) StateMachine(org.webpieces.javasm.api.StateMachine) Stream(com.webpieces.http2engine.impl.shared.data.Stream) SENT_RST(com.webpieces.http2engine.impl.shared.data.Http2Event.SENT_RST) Memento(org.webpieces.javasm.api.Memento) StreamException(com.webpieces.http2parser.api.dto.error.StreamException) Logger(org.webpieces.util.logging.Logger) AsyncLock(com.webpieces.util.locking.AsyncLock) CancelReason(com.webpieces.http2parser.api.dto.CancelReason) PermitQueue(com.webpieces.util.locking.PermitQueue) SENT_HEADERS_EOS(com.webpieces.http2engine.impl.shared.data.Http2Event.SENT_HEADERS_EOS) ConnectionException(com.webpieces.http2parser.api.dto.error.ConnectionException) LoggerFactory(org.webpieces.util.logging.LoggerFactory) Http2PayloadType(com.webpieces.http2engine.impl.shared.data.Http2PayloadType) DataFrame(com.webpieces.http2parser.api.dto.DataFrame) Http2Event(com.webpieces.http2engine.impl.shared.data.Http2Event)

Aggregations

Http2Headers (com.webpieces.hpack.api.dto.Http2Headers)1 Http2Push (com.webpieces.hpack.api.dto.Http2Push)1 Http2Event (com.webpieces.http2engine.impl.shared.data.Http2Event)1 Http2SendRecieve (com.webpieces.http2engine.impl.shared.data.Http2Event.Http2SendRecieve)1 RECV_DATA_EOS (com.webpieces.http2engine.impl.shared.data.Http2Event.RECV_DATA_EOS)1 RECV_HEADERS_EOS (com.webpieces.http2engine.impl.shared.data.Http2Event.RECV_HEADERS_EOS)1 RECV_RST (com.webpieces.http2engine.impl.shared.data.Http2Event.RECV_RST)1 SENT_DATA_EOS (com.webpieces.http2engine.impl.shared.data.Http2Event.SENT_DATA_EOS)1 SENT_HEADERS_EOS (com.webpieces.http2engine.impl.shared.data.Http2Event.SENT_HEADERS_EOS)1 SENT_RST (com.webpieces.http2engine.impl.shared.data.Http2Event.SENT_RST)1 Http2PayloadType (com.webpieces.http2engine.impl.shared.data.Http2PayloadType)1 NoTransitionConnectionError (com.webpieces.http2engine.impl.shared.data.NoTransitionConnectionError)1 NoTransitionStreamError (com.webpieces.http2engine.impl.shared.data.NoTransitionStreamError)1 Stream (com.webpieces.http2engine.impl.shared.data.Stream)1 CancelReason (com.webpieces.http2parser.api.dto.CancelReason)1 DataFrame (com.webpieces.http2parser.api.dto.DataFrame)1 CancelReasonCode (com.webpieces.http2parser.api.dto.error.CancelReasonCode)1 ConnectionException (com.webpieces.http2parser.api.dto.error.ConnectionException)1 StreamException (com.webpieces.http2parser.api.dto.error.StreamException)1 Http2Msg (com.webpieces.http2parser.api.dto.lib.Http2Msg)1