Class SockJSSocket
- All Implemented Interfaces:
MutinyDelegate
,ReadStream<Buffer>
,StreamBase
,WriteStream<Buffer>
The API is very similar to WebSocket
.
It implements both and
so it can be used with
Pump
to pump data with flow control.
NOTE: This class has been automatically generated from the
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSockJSSocket
(io.vertx.ext.web.handler.sockjs.SockJSSocket delegate) SockJSSocket
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
closeHandler
(Runnable closeHandler) drainHandler
(Runnable handler) io.smallrye.mutiny.Uni<Void>
end()
Same asWriteStream.end()
but with anhandler
called when the operation completesio.smallrye.mutiny.Uni<Void>
Same as but with anhandler
called when the operation completesBlocking variant ofWriteStream.end()
.endAndAwait
(Buffer data) Blocking variant ofWriteStream.end(T)
.void
Variant ofWriteStream.end()
that ignores the result of the operation.void
endAndForget
(Buffer data) Variant ofWriteStream.end(T)
that ignores the result of the operation.endHandler
(Runnable endHandler) boolean
exceptionHandler
(Consumer<Throwable> handler) fetch
(long amount) io.vertx.ext.web.handler.sockjs.SockJSSocket
int
hashCode()
headers()
static SockJSSocket
newInstance
(io.vertx.ext.web.handler.sockjs.SockJSSocket arg) pause()
pipe()
io.smallrye.mutiny.Uni<Void>
pipeTo
(WriteStream<Buffer> dst) Pipe thisReadStream
to theWriteStream
.pipeToAndAwait
(WriteStream<Buffer> dst) Blocking variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
.void
pipeToAndForget
(WriteStream<Buffer> dst) Variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
that ignores the result of the operation.resume()
setWriteQueueMaxSize
(int maxSize) io.smallrye.mutiny.Multi<Buffer>
toMulti()
toString()
uri()
webUser()
io.smallrye.mutiny.Uni<Void>
Same as but with anhandler
called when the operation completesio.smallrye.mutiny.Uni<Void>
writeAndAwait
(Buffer data) Blocking variant ofWriteStream.write(T)
.writeAndAwait
(String data) void
writeAndForget
(Buffer data) Variant ofWriteStream.write(T)
that ignores the result of the operation.void
writeAndForget
(String data) boolean
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
SockJSSocket
public SockJSSocket(io.vertx.ext.web.handler.sockjs.SockJSSocket delegate) -
SockJSSocket
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.handler.sockjs.SockJSSocket getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Specified by:
getDelegate
in interfaceReadStream<Buffer>
- Specified by:
getDelegate
in interfaceStreamBase
- Specified by:
getDelegate
in interfaceWriteStream<Buffer>
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
toSubscriber
-
end
Description copied from interface:WriteStream
Same asWriteStream.end()
but with anhandler
called when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
end
in interfaceWriteStream<Buffer>
- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Description copied from interface:WriteStream
Blocking variant ofWriteStream.end()
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
endAndAwait
in interfaceWriteStream<Buffer>
- Returns:
- the Void instance produced by the operation.
-
endAndForget
public void endAndForget()Description copied from interface:WriteStream
Variant ofWriteStream.end()
that ignores the result of the operation.This method subscribes on the result of
WriteStream.end()
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWriteStream.end()
but you don't need to compose it with other operations.- Specified by:
endAndForget
in interfaceWriteStream<Buffer>
-
end
Description copied from interface:WriteStream
Same as but with anhandler
called when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
end
in interfaceWriteStream<Buffer>
- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
endAndAwait
Description copied from interface:WriteStream
Blocking variant ofWriteStream.end(T)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
endAndAwait
in interfaceWriteStream<Buffer>
- Returns:
- the Void instance produced by the operation.
-
endAndForget
Description copied from interface:WriteStream
Variant ofWriteStream.end(T)
that ignores the result of the operation.This method subscribes on the result of
WriteStream.end(T)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWriteStream.end(T)
but you don't need to compose it with other operations.- Specified by:
endAndForget
in interfaceWriteStream<Buffer>
-
writeQueueFull
public boolean writeQueueFull()- Specified by:
writeQueueFull
in interfaceWriteStream<Buffer>
- Returns:
true
if write queue is full
-
pipe
- Specified by:
pipe
in interfaceReadStream<Buffer>
- Returns:
- a pipe
-
pipeTo
Description copied from interface:ReadStream
Pipe thisReadStream
to theWriteStream
.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the
handler
will be called with the result.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
pipeTo
in interfaceReadStream<Buffer>
- Parameters:
dst
- the destination write stream- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
pipeToAndAwait
Description copied from interface:ReadStream
Blocking variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
pipeToAndAwait
in interfaceReadStream<Buffer>
- Parameters:
dst
- the destination write stream- Returns:
- the Void instance produced by the operation.
-
pipeToAndForget
Description copied from interface:ReadStream
Variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
that ignores the result of the operation.This method subscribes on the result of
ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
but you don't need to compose it with other operations.- Specified by:
pipeToAndForget
in interfaceReadStream<Buffer>
- Parameters:
dst
- the destination write stream
-
exceptionHandler
- Specified by:
exceptionHandler
in interfaceReadStream<Buffer>
- Specified by:
exceptionHandler
in interfaceStreamBase
- Specified by:
exceptionHandler
in interfaceWriteStream<Buffer>
- Parameters:
handler
- the exception handler- Returns:
-
handler
- Specified by:
handler
in interfaceReadStream<Buffer>
- Returns:
-
pause
- Specified by:
pause
in interfaceReadStream<Buffer>
- Returns:
- a reference to this, so the API can be used fluently
-
resume
- Specified by:
resume
in interfaceReadStream<Buffer>
- Returns:
- a reference to this, so the API can be used fluently
-
fetch
- Specified by:
fetch
in interfaceReadStream<Buffer>
- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
- Specified by:
endHandler
in interfaceReadStream<Buffer>
- Returns:
-
closeHandler
-
write
-
writeAndAwait
-
writeAndForget
-
write
Description copied from interface:WriteStream
Same as but with anhandler
called when the operation completesUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
write
in interfaceWriteStream<Buffer>
- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
writeAndAwait
Description copied from interface:WriteStream
Blocking variant ofWriteStream.write(T)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
writeAndAwait
in interfaceWriteStream<Buffer>
- Returns:
- the Void instance produced by the operation.
-
writeAndForget
Description copied from interface:WriteStream
Variant ofWriteStream.write(T)
that ignores the result of the operation.This method subscribes on the result of
WriteStream.write(T)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromWriteStream.write(T)
but you don't need to compose it with other operations.- Specified by:
writeAndForget
in interfaceWriteStream<Buffer>
-
setWriteQueueMaxSize
- Specified by:
setWriteQueueMaxSize
in interfaceWriteStream<Buffer>
- Parameters:
maxSize
- the max size of the write stream- Returns:
- a reference to this, so the API can be used fluently
-
drainHandler
- Specified by:
drainHandler
in interfaceWriteStream<Buffer>
- Parameters:
handler
- the handler- Returns:
-
writeHandlerID
- Returns:
- the
writeHandlerID
ornull
ifwriteHandler
registration is disabled inSockJSHandlerOptions
-
close
public void close() -
close
- Parameters:
statusCode
-reason
-
-
remoteAddress
- Returns:
-
localAddress
- Returns:
-
headers
- Returns:
-
uri
- Returns:
-
routingContext
- Returns:
- the Vert.x-Web RoutingContext corresponding to this socket
-
webSession
- Returns:
- the Vert.x-Web session corresponding to this socket
-
webUser
- Returns:
- the Vert.x-Web user corresponding to this socket
-
toMulti
- Specified by:
toMulti
in interfaceReadStream<Buffer>
-
toBlockingIterable
-
toBlockingStream
-
newInstance
-