flux_msg_create(3)

SYNOPSIS

#include <flux/core.h>

flux_msg_t *flux_msg_create (int type)

flux_msg_t *flux_msg_copy (const flux_msg_t *msg, bool payload)

const flux_msg_t *flux_msg_incref (const flux_msg_t *msg)

void flux_msg_decref (const flux_msg_t *msg)

void flux_msg_destroy (flux_msg_t *msg)

DESCRIPTION

flux_msg_create() creates a flux_msg_t of type. Different types of Flux messages are defined in RFC 3/Flux Message Protocol. All messages have a starting reference count of 1.

flux_msg_copy() duplicates msg. The payload is omitted unless payload is true. The initial reference count of the new message is 1.

flux_msg_incref() increments the reference count of msg by 1.

flux_msg_decref() decrements the reference count of msg by 1. When the reference count reaches 0, the message is destroyed.

flux_msg_destroy() is an alias for flux_msg_decref().

RETURN VALUE

flux_msg_create() and flux_msg_copy() return a flux_msg_t type on success. On failure, NULL is returned and errno is set.

flux_msg_incref() returns a constant pointer to msg for convenience. On failure, NULL is returned and errno is set.

flux_msg_decref() and flux_msg_destroy() have no return value.

ERRORS

ENOMEM

Out of memory.

EINVAL

Invalid message or message type.

RESOURCES

Flux: http://flux-framework.org

Flux RFC: https://flux-framework.readthedocs.io/projects/flux-rfc

SEE ALSO

flux_send(3), flux_respond(3)