Class RealtimeStreamSpecV1
java.lang.Object
com.kingsrook.qqq.middleware.javalin.specs.AbstractEndpointSpec<RealtimeExecutor.Input,RealtimeExecutor.Output,RealtimeExecutor>
com.kingsrook.qqq.middleware.javalin.specs.v1.RealtimeStreamSpecV1
- All Implemented Interfaces:
AutoCloseable
public class RealtimeStreamSpecV1
extends AbstractEndpointSpec<RealtimeExecutor.Input,RealtimeExecutor.Output,RealtimeExecutor>
implements AutoCloseable
Authenticated v1 SSE stream. One virtual writer per stream; hub callbacks only enqueue.
-
Field Summary
Fields inherited from class com.kingsrook.qqq.middleware.javalin.specs.AbstractEndpointSpec
qInstance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildInput(io.javalin.http.Context context) Authentication has already established QContext before this runs.voidclose()Server shutdown releases the hub even if no clients remain.Declare the streaming contract without an extension-point dependency.The 200 response is explicitly a stream, not a JSON response.Every named core event is a separate schema component.A reconnect cursor never grants ownership of another session connection.getHub()Initialize lazily so OpenAPI generation does not start resources.voidhandleOutput(io.javalin.http.Context context, RealtimeExecutor.Output output) Use Javalin SSE lifetime handling and one virtual writer for ordered frames.voidsetQInstance(QInstance instance) A metadata hot swap retires connections bound to the prior instance.Methods inherited from class com.kingsrook.qqq.middleware.javalin.specs.AbstractEndpointSpec
checkCredentialScopeOperation, customizeMethod, defineAdditionalBasicResponses, defineCompleteOperation, defineMethod, defineRequestBody, defineResponses, defineRoute, getOperationId, getRequestBodyAsJsonObject, getRequestParam, getRequestParamInteger, getRequestParamMap, handleException, isSecured, newExecutor, newOutput, serveRequest
-
Constructor Details
-
RealtimeStreamSpecV1
public RealtimeStreamSpecV1()
-
-
Method Details
-
defineBasicOperation
Declare the streaming contract without an extension-point dependency. -
defineRequestParameters
A reconnect cursor never grants ownership of another session connection. -
defineBasicSuccessResponse
The 200 response is explicitly a stream, not a JSON response. -
defineComponentSchemas
Every named core event is a separate schema component. -
getHub
Initialize lazily so OpenAPI generation does not start resources. -
setQInstance
A metadata hot swap retires connections bound to the prior instance.- Overrides:
setQInstancein classAbstractEndpointSpec<RealtimeExecutor.Input,RealtimeExecutor.Output, RealtimeExecutor>
-
buildInput
Authentication has already established QContext before this runs.- Specified by:
buildInputin classAbstractEndpointSpec<RealtimeExecutor.Input,RealtimeExecutor.Output, RealtimeExecutor>
-
handleOutput
Use Javalin SSE lifetime handling and one virtual writer for ordered frames.- Overrides:
handleOutputin classAbstractEndpointSpec<RealtimeExecutor.Input,RealtimeExecutor.Output, RealtimeExecutor>
-
close
public void close()Server shutdown releases the hub even if no clients remain.- Specified by:
closein interfaceAutoCloseable
-