18 #ifndef YAMI4INDUSTRY_AGENT_H
19 #define YAMI4INDUSTRY_AGENT_H
95 struct yami_channel channels_array[],
size_t channels_array_size);
129 struct yami_channel channels_array[],
size_t channels_array_size);
220 const char target[]);
235 const char target[]);
250 const char target[]);
264 const char target[], int32_t * out_busy);
289 const uint8_t header[],
size_t header_size,
290 const uint8_t body[],
size_t body_size);
314 const char target[],
const char object_name[],
const char message_name[],
315 const uint8_t body[],
size_t body_size,
316 int64_t * out_message_id);
339 const char target[], int64_t message_id,
340 const uint8_t body[],
size_t body_size);
363 const char target[], int64_t message_id,
const char reason[]);
int32_t listening_socket_
Definition: agent.h:46
struct yami_channel * channels_array_
Definition: agent.h:59
void(* yami_io_error_function)(int32_t error_code, const char description[])
Definition: callbacks.h:81
void(* yami_message_function)(const char target[], enum yami_message_type message_type, const char object_name[], const char message_name[], const char exception_msg[], int64_t message_id, const uint8_t body[], size_t body_size)
Definition: callbacks.h:69
void yami_init_with_options(struct yami_agent *self, const struct yami_options *options)
Initializer.
Definition: agent.c:118
enum yami_result yami_post_reply(struct yami_agent *self, const char target[], int64_t message_id, const uint8_t body[], size_t body_size)
Posts the high-level message reply.
Definition: agent.c:378
void yami_set_connection_callback(struct yami_agent *self, yami_connection_event_function connection_callback)
Sets the connection event callback.
Definition: agent.c:195
struct yami_channel channels_[MAX_NUMBER_OF_CHANNELS]
Definition: agent.h:62
yami_connection_event_function connection_callback_
Definition: agent.h:55
yami_result
Definition: common.h:28
enum yami_result yami_close_connection(struct yami_agent *self, const char target[])
Closes communication channel.
Definition: agent.c:276
void(* yami_connection_event_function)(enum yami_connection_event event, const char target[])
Definition: callbacks.h:98
void yami_init_with_user_array(struct yami_agent *self, struct yami_channel channels_array[], size_t channels_array_size)
Initializer.
Definition: agent.c:110
int64_t last_message_id_
Definition: agent.h:50
enum yami_protocol listening_protocol_
Definition: agent.h:47
Message broker.
Definition: agent.h:44
void yami_set_message_callback(struct yami_agent *self, yami_message_function message_callback)
Sets the high-level message callback.
Definition: agent.c:189
enum yami_result yami_post_message(struct yami_agent *self, const char target[], const char object_name[], const char message_name[], const uint8_t body[], size_t body_size, int64_t *out_message_id)
Posts the high-level message.
Definition: agent.c:351
void yami_init(struct yami_agent *self)
Initializer.
Definition: agent.c:103
enum yami_result yami_clean(struct yami_agent *self)
Destructor.
Definition: agent.c:135
enum yami_result yami_set_listener(struct yami_agent *self, const char target[])
Sets the optional listener.
Definition: agent.c:201
void yami_set_raw_message_callback(struct yami_agent *self, yami_raw_message_function raw_message_callback)
Sets the raw message callback.
Definition: agent.c:183
#define MAX_NUMBER_OF_CHANNELS
Definition: limits.h:26
void yami_set_io_error_callback(struct yami_agent *self, yami_io_error_function io_error_callback)
Sets the error logger callback function.
Definition: agent.c:177
yami_message_function message_callback_
Definition: agent.h:53
enum yami_result yami_do_some_work(struct yami_agent *self, size_t timeout)
Performs some unit of network-related activity.
Definition: agent.c:641
yami_raw_message_function raw_message_callback_
Definition: agent.h:52
yami_io_error_function io_error_callback_
Definition: agent.h:54
struct yami_options options_
Definition: agent.h:57
void(* yami_raw_message_function)(const char target[], const uint8_t header[], size_t header_size, const uint8_t body[], size_t body_size)
Definition: callbacks.h:39
enum yami_result yami_post_reject(struct yami_agent *self, const char target[], int64_t message_id, const char reason[])
Posts the high-level message rejection.
Definition: agent.c:400
size_t channels_array_size_
Definition: agent.h:60
yami_protocol
Definition: channel.h:34
uint32_t last_core_message_id_
Definition: agent.h:49
void yami_init_with_options_ua(struct yami_agent *self, const struct yami_options *options, struct yami_channel channels_array[], size_t channels_array_size)
Initializer.
Definition: agent.c:126
enum yami_result yami_is_output_channel_busy(const struct yami_agent *self, const char target[], int32_t *out_busy)
Checks if there is space in the output channel.
Definition: agent.c:311
enum yami_result yami_open_connection(struct yami_agent *self, const char target[])
Creates (opens) outgoing communication channel.
Definition: agent.c:265
enum yami_result yami_post_raw_message(struct yami_agent *self, const char target[], const uint8_t header[], size_t header_size, const uint8_t body[], size_t body_size)
Posts the raw message.
Definition: agent.c:328