holoscan::ChannelPublisher< Tensor >
Publish Tensors through one catalog-attached, endpoint-owned allocation domain.
The attached import endpoint owns a finite preallocated publication pool and supplies the logical Tensor contract, capture-clock authority, and optional clock-health lane. The facade never exposes allocator injection, a bare-Tensor emit, publisher-created Sample<Tensor>, HoloMQ/BufferHandle state, or a process-local physical resource handle. The caller must serialize every publication call on one live facade, including emit*, close(), and report_clock_health(). Transport release callbacks are synchronized internally. Filling distinct acquired loans may overlap only within bounds later admitted by the attached endpoint.
Assignment operators
operator=
Deleted overloads
The following overloads are deleted to prevent misuse:
Methods
ChannelPublisher
Overload 1
Overload 3
Deleted overload
Transfer endpoint publication authority from another facade.
other is closed and its checked operations return ErrorCode::kClosed.
Parameters
Publisher whose authority becomes moved from.
Destructor
~ChannelPublisher< Tensor >
Destroy the facade and release its source-private endpoint ownership.
loan_tensor
Acquire one endpoint-owned external Tensor publication loan without blocking.
Request shape and stride views are copied before this call returns. Pool exhaustion is reported immediately and never falls back to allocation or blocking.
Returns: Sole unpublished loan, ErrorCode::kResourceExhausted when a finite admitted resource is unavailable, or another checked endpoint/layout error.
Parameters
Logical shape, dtype, and optional byte strides copied during this call.
emit
Consume and publish one ready endpoint-owned Tensor loan.
A post-submit outcome that cannot prove zero delivery returns ErrorCode::kPublicationIndeterminate or ErrorCode::kPublicationPartial and must not be retried as the same sample.
Returns: Exact reached-recipient count, or a checked publication error.
Parameters
Sole unpublished authority consumed on success or failure.
Optional capture, frame, trace, and admitted flag metadata.
emit_captured
Consume and publish one loan with a coordinate in the bound capture clock.
Returns: Exact reached-recipient count, or a checked capture/publication error.
Parameters
Sole unpublished authority consumed on success or failure.
Exact caller-supplied capture coordinate in nanoseconds.
Remaining metadata; an existing capture time is invalid.
emit_sample
Consume and publish one loan with explicit public sample metadata.
Returns: Exact reached-recipient count, or a checked metadata/publication error.
Parameters
Sole unpublished authority consumed on success or failure.
Caller semantic metadata. Runtime replaces sequence, publication time/clock, byte size, and payload kind with locally authoritative values.
emit_copy
Copy an admitted foreign Tensor into endpoint-owned catalog storage and publish it.
This is the sole catalog-backed foreign-storage path. It never changes the source into exportable storage in place. A host destination performs one producer-stream-ordered device-to-host materialization and synchronizes before submission. A same-device CUDA destination enqueues one device-to-device copy and generation fence without blocking the host. Direct zero-copy export requires separately admitted physical resources.
Returns: Exact reached-recipient count, or a checked source/copy/publication error.
Parameters
Contiguous CPU, CUDA device, or CUDA managed source. Device source backing is retained or release-ordered internally until the asynchronous copy completes.
Borrowed producer stream. CPU sources require a null stream; CUDA device and managed sources require the non-null stream that orders producer completion.
Optional capture, frame, trace, and admitted flag metadata.
make_capture_time
Label one coordinate with this catalog endpoint’s capture clock.
Returns: Bound time point, or a checked closed/authority error.
Parameters
Exact caller-supplied nanosecond coordinate.
report_clock_health
Publish one endpoint-bound clock-health report without borrowing a Tensor slot.
Returns: Empty success after local bounded acceptance, or a checked contract/publication error.
Parameters
Valid payload-independent assessment and portable reason.
close
Publish an explicit ordered end-of-stream operation and consume this generation.
Destruction, disconnect, silence, and process exit do not publish or imply EOS.
With a lossy replacement policy, BufferHandle EOS uses a bounded protected terminal lane and a recipient drains its Tensor data lane before observing EOS. New data may replace stale data, but EOS cannot replace the final unread Tensor accepted by that recipient. QueuePolicy::kBlocking keeps data and EOS on its existing lossless FIFO lane.
Returns: Success after every frozen recipient accepts EOS.
update_connections
Refresh the backend connection snapshot used by has_subscribers.
Returns: Empty success, or a checked closed/backend refresh error.
has_subscribers
Return the most recently refreshed subscriber-presence snapshot.
This advisory value is not proof that a later emit reaches any recipient.
Returns: True when a subscriber was observed; false when moved from, closed, or disconnected.