Package ke.ric.renderer.api
Class RenderStream
java.lang.Object
ke.ric.renderer.api.RenderStream
- All Implemented Interfaces:
AutoCloseable
Lifecycle handle for a live camera feed. All configured callbacks and map/entity mutations run
on the server thread. Use
stop() or close() when the feed is no longer needed;
owner disable also stops it. Stop removes only owned temporary output, never saved photos.
Transient queue pressure, stale evidence or unloaded required chunks can skip frames. A feed
without usable evidence for one second enters NO_SIGNAL and can recover. Permanent errors end
the feed and complete completion() exceptionally. Frame rate is a target, not a guarantee.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCurrent externally useful state; absence of recent evidence produces NO_SIGNAL. -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()Reports whether a stop or terminal failure has been requested.voidclose()Equivalent tostop().Observes stream termination.Returns the latest observed error, including errors from which the stream can recover.Returns the most recently published frame while active.status()Returns the current output/lifecycle state.voidstop()Requests stop, cancels owned work and removes only this stream's temporary outputs.
-
Method Details
-
active
public boolean active()Reports whether a stop or terminal failure has been requested. This is a snapshot, not a lease that guarantees a subsequent operation will succeed.- Returns:
- true while the feed can still produce frames
-
status
Returns the current output/lifecycle state. NO_SIGNAL can recover; STOPPED and FAILED are terminal.- Returns:
- current stream status
-
lastError
Returns the latest observed error, including errors from which the stream can recover. A nonnull error alone does not imply terminal failure; inspect status() or completion().- Returns:
- the most recent error, or null if none has occurred
-
lastFrame
Returns the most recently published frame while active. Composite frames retain their composition reservation until replacement or stop. The frame is immutable.- Returns:
- the latest frame, or null before first delivery and after stop
-
completion
Observes stream termination. Normal stop/source end completes normally; permanent failures complete exceptionally. Cancelling this future stops the stream. Ordinary future continuations have normal Java threading semantics; never wait for termination on the server thread.- Returns:
- the stream's completion future
-
stop
public void stop()Requests stop, cancels owned work and removes only this stream's temporary outputs. Idempotent and callable from any thread; Bukkit cleanup is dispatched to the server thread. -
close
public void close()Equivalent tostop().- Specified by:
closein interfaceAutoCloseable
-