Search in sources :

Example 1 with PushStreamHandle

use of com.webpieces.http2.api.streaming.PushStreamHandle in project webpieces by deanhiller.

the class Level8NotifyClntListeners method sendPushToApp.

public XFuture<Void> sendPushToApp(ClientPushStream stream, Http2Push fullPromise) {
    ResponseStreamHandle listener = stream.getOriginalResponseListener();
    PushStreamHandle pushHandle = listener.openPushStream();
    stream.setPushStreamHandle(pushHandle);
    return pushHandle.process(fullPromise).thenApply(l -> {
        stream.setPushPromiseListener(l);
        return null;
    });
}
Also used : PushStreamHandle(com.webpieces.http2.api.streaming.PushStreamHandle) ResponseStreamHandle(com.webpieces.http2.api.streaming.ResponseStreamHandle)

Example 2 with PushStreamHandle

use of com.webpieces.http2.api.streaming.PushStreamHandle in project webpieces by deanhiller.

the class Level8NotifyClntListeners method sendRstToApp.

@Override
public XFuture<Void> sendRstToApp(Stream stream, CancelReason payload) {
    if (stream instanceof ClientStream) {
        ClientStream str = (ClientStream) stream;
        ResponseStreamHandle handler = str.getResponseListener();
        return handler.cancel(payload);
    }
    ClientPushStream str = (ClientPushStream) stream;
    PushStreamHandle handle = str.getPushStreamHandle();
    return handle.cancelPush(payload);
}
Also used : PushStreamHandle(com.webpieces.http2.api.streaming.PushStreamHandle) ResponseStreamHandle(com.webpieces.http2.api.streaming.ResponseStreamHandle)

Aggregations

PushStreamHandle (com.webpieces.http2.api.streaming.PushStreamHandle)2 ResponseStreamHandle (com.webpieces.http2.api.streaming.ResponseStreamHandle)2