StreamSPI

<p>The SPI interface for implementing a HTTP/2 stream.</p> <p>This class :{@link Stream} by adding the methods required to implement the HTTP/2 stream functionalities.</p>

Members

Functions

close
void close()

<p>Forcibly closes this stream.</p>

getListener
Listener getListener()

@return the {@link hunt.http.codec.http.stream.Stream.Listener} associated with this stream @see #setListener(Stream.Listener)

getSession
SessionSPI getSession()
Undocumented in source.
isLocal
bool isLocal()

@return whether this stream is local or remote

isRemotelyClosed
bool isRemotelyClosed()

@return whether the stream is closed remotely. @see #isClosed()

process
void process(Frame frame, Callback callback)

<p>Processes the given {@code frame}, belonging to this stream.</p>

setListener
void setListener(Listener listener)

@param listener the {@link hunt.http.codec.http.stream.Stream.Listener} associated with this stream @see #getListener()

updateClose
bool updateClose(bool update, CloseStateEvent event)

<p>Updates the close state of this stream.</p>

updateRecvWindow
int updateRecvWindow(int delta)

<p>Updates the stream receive window by the given {@code delta}.</p>

updateSendWindow
int updateSendWindow(int delta)

<p>Updates the stream send window by the given {@code delta}.</p>

Inherited Members

From Stream

getId
int getId()

@return the stream unique id

getSession
Session getSession()

@return the session this stream is associated to

headers
void headers(HeadersFrame frame, Callback callback)

<p>Sends the given HEADERS {@code frame} representing a HTTP response.</p>

push
void push(PushPromiseFrame frame, Promise!Stream promise, Listener listener)

<p>Sends the given PUSH_PROMISE {@code frame}.</p>

data
void data(DataFrame frame, Callback callback)

<p>Sends the given DATA {@code frame}.</p>

reset
void reset(ResetFrame frame, Callback callback)

<p>Sends the given RST_STREAM {@code frame}.</p>

getAttribute
Object getAttribute(string key)

@param key the attribute key @return an arbitrary object associated with the given key to this stream or null if no object can be found for the given key. @see #setAttribute(string, Object)

setAttribute
void setAttribute(string key, Object value)

@param key the attribute key @param value an arbitrary object to associate with the given key to this stream @see #getAttribute(string) @see #removeAttribute(string)

removeAttribute
Object removeAttribute(string key)

@param key the attribute key @return the arbitrary object associated with the given key to this stream @see #setAttribute(string, Object)

isReset
bool isReset()

@return whether this stream has been reset

isClosed
bool isClosed()

@return whether this stream is closed, both locally and remotely.

toString
string toString()

@param idleTimeout the stream idle timeout @see #getIdleTimeout() @see Stream.Listener#onIdleTimeout(Stream, Exception)

Listener
interface Listener

<p>A {@link Stream.Listener} is the passive counterpart of a {@link Stream} and receives events happening on a HTTP/2 stream.</p>

Meta