Skip to main content


ec_message_builder — Convenience routine for building messages in a blocking fashion


#include "ec_message.h"

| io_object * **ec_message_builder** ( | mess, |   | |   | size_hint); |   |

ec_message * <var class="pdparam">mess</var>; size_t <var class="pdparam">size_hint</var>;


Convenience routine for building messages in a blocking fashion.


If you are constructing a message internally, this API will return an IO object that will hold the message as it is constructed. Each write to the object will incrementally parse that chunk into the message you have provided. If the message is larger than the large message threshold, it will internally be journalled to the spool in much the same way that large messages are received over SMTP. When the io_object is closed, it will finalize the parse and call ec_message_set_io_object() with the underlying storage for the message.



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


An integer indicating the approximate size of the final message (in bytes) if known in advance.

Return Values

Returns the address of an io_object struct, which stores the current state of the message as it's being constructed. For documentation of this data structure see “io_object”


It is legal to call this function in any thread but should not be called in the Scheduler thread.


This function may induce IO blocking or otherwise block the caller. Blocking in the scheduler thread will lead to degraded performance and should be avoided at all costs. If your code is running in the IO subsystem, the core will have already taken steps to ensure that blocking is acceptable. Otherwise, you should look at using the thread pool API to run a job in the IO pool.

Was this page helpful?