ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
nats_publish_action_handler Class Referencefinal

Fires a NATS publish on each job firing. More...

#include <nats_publish_action_handler.hpp>

Inheritance diagram for nats_publish_action_handler:
Inheritance graph
Collaboration diagram for nats_publish_action_handler:
Collaboration graph

Public Member Functions

 nats_publish_action_handler (ores::nats::service::client &nats)
 
std::string_view action_type () const noexcept override
 Returns the action_type string handled by this implementation.
 
boost::asio::awaitable< std::expected< void, std::string > > execute (const action_context &ctx) override
 Execute the action for the given job.
 

Detailed Description

Fires a NATS publish on each job firing.

Handles jobs with action_type == "nats_publish". The action_payload JSON must contain: {"subject":"<nats-subject>"}.

The message body is empty — the subject alone is sufficient to trigger fire-and-forget compute operations such as the stale-result reaper.

Member Function Documentation

◆ action_type()

std::string_view action_type ( ) const
overridevirtualnoexcept

Returns the action_type string handled by this implementation.

Implements action_handler.

◆ execute()

boost::asio::awaitable< std::expected< void, std::string > > execute ( const action_context ctx)
overridevirtual

Execute the action for the given job.

Returns
An expected<void, string> where the string contains the error message on failure.

Implements action_handler.