ec_message_blobject_store

March 26, 2020 Contributors

Name

ec_message_blobject_store — Tag a message with a blobject

Synopsis

#include "ec_message.h"

| void **ec_message_blobject_store** ( | msg, |   |
|   | key, |   |
|   | obj); |   |

ec_message * <var class="pdparam">msg</var>;
const char * <var class="pdparam">key</var>;
ec_blobject * <var class="pdparam">obj</var>;

Description

Tag a message with a blobject using a key. The object reference will be held in memory for the entire lifetime of the message, but will not survive a restart of the server. This facility allows referencing arbitrary context alongside the message, but should be used sparingly to avoid excessive memory usage; there is no way to discard the objects and reinstate them if we decide to trim back resource usage for a given message.

Parameters

msg

The message to tag. A pointer to an ec_message struct. For documentation of this data structure see “ec_message”.

key

Identifies the string used to tag the message.

obj

The object to store. A pointer to an ec_blobject struct. For documentation of this data structure see “ec_blobject”. The message will take a reference on the object while it is stored in the hash. If an object is already present with the same key, its reference will be deleted and the new object will replace it.

Return Values

This function returns void.

Threading

It is legal to call this function in any thread.

See Also

ec_message_blobject_get and ec_message_blobject_remove.