MONGOC_CLIENT_...REAM_INITIATOR(3)
okay bestie, welcome to the libmongoc manual page MONGOC_CLIENT_...REAM_INITIATOR(3) β yes the title is giving truncated-chaos, but the actual main character is mongoc_client_set_stream_initiator() π
β¨
β¨ SYNOPSIS β¨
void
mongoc_client_set_stream_initiator (mongoc_client_t *client,
mongoc_stream_initiator_t initiator,
void *user_data);
Okay so mongoc_client_set_stream_initiator() shall associate a given mongoc_client_t with a new stream initiator. This will completely replace the default transport (buffered TCP, possibly with TLS). No cap, it's a full transport glow-up. The initiator should fulfill the mongoc_stream_t contract. user_data is passed through to the initiator callback and may be used for whatever run time customization is necessary. π¦
β οΈ It is a programming error to call this function on amongoc_client_tfrom amongoc_client_pool_t. Like, do not do it. Said with love. π
Changed in version 2.0.0: This function logs an error and immediately returns if client is from a mongoc_client_pool_t. Previously this function unsafely applied the initiator to the pooled client. So yeah, the old behavior was lowkey unsafe and we do not stan. π
If user_data is passed, it is the application's responsibility to ensure user_data remains valid for the lifetime of the client. Keep that pointer alive, bestie β it is not a vibe to have it ghosting you mid-callback. π«Ά
π«Ά PARAMETERS π«Ά
client: Amongoc_client_t.initiator: Amongoc_stream_initiator_t.user_data: User supplied pointer for callback function.
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
signed off from libmongoc version 2.5.6, dated Oct 09, 202 β the year is giving cliffhanger, but the vibes are immaculate. πβ¨
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms