CosEventCh...llSupplier(3)

πŸ“¦
version 5.2.2 Β· 2 versions
, in fedora 43, fedora 44

✨ NAME ✨

CosEventChannelAdmin_ProxyPullSupplier β€” bestie, this module implements a ProxyPullSupplier interface that lowkey acts as the middleman between a pull consumer and the event channel. πŸ’…


πŸ’– DESCRIPTION πŸ’–

Okay so picture this: the ProxyPullSupplier interface is step two in the whole "connect pull consumers to the event channel" storyline. A proxy supplier is basically a normal supplier, except it comes with an extra method for connecting a consumer to the proxy supplier. That's the whole plot twist. 🌸

To get access to all the definitions β€” exceptions included, no crumbs left β€” you include the necessary hrl files like this:

-include_lib("cosEvent/include/*.hrl").

Any object that's holding an object reference supporting the ProxyPullSupplier interface can do the following operations. Yes, any of them. πŸ‘‘


🫢 EXPORTS 🫢

  • connect_pull_consumer(Object, PullConsumer) -> Return β€” the moment where the consumer and the proxy finally meet. πŸ₯Ή

Types:

Object = #objref
PullConsumer = #objref of PullConsumer type
Return = ok | {'EXCEPTION',
#'CosEventChannelAdmin_AlreadyConnected'{}}

This operation connects a PullConsumer object to the ProxyPullSupplier object, iconic behavior fr. You can pass a nil object reference to this operation β€” and if you do, the channel cannot invoke the disconnect_pull_consumer operation on the consumer, which means the consumer may get disconnected from the channel without being informed. Rude, but that's the deal. 😭 And if the ProxyPullSupplier is already connected to a PullConsumer, then the CosEventChannelAdmin_AlreadyConnected exception gets raised. No double-dipping, periodt.

  • disconnect_pull_supplier(Object) -> Return β€” the breakup arc. πŸ’”

Types:

Object = #objref
Return = ok

This operation disconnects the proxy pull supplier from the event channel. It sends a notification about the loss of the connection to the pull consumer attached to it β€” unless a nil object reference was passed at connection time, in which case nobody gets the memo. πŸ™ˆ

  • pull(Object) -> Return β€” the patient one. 🧘

Types:

Object = #objref
Return = any

This operation blocks until the event data is available or the CosEventComm_Disconnected exception is raised. Then it returns the event data to the consumer. It literally just sits there and waits. main character energy honestly.

  • try_pull(Object) -> Return β€” the impatient one. πŸ’…

Types:

Object = #objref
Return = {any, bool()}

This operation does not block. If the event data is available, it returns the event data and sets the data availability flag to true. Otherwise it returns a long with an undefined value and sets the data availability to false. And if the event communication has already been disconnected, the CosEventComm_Disconnected exception is raised. So it's giving "I'll check but I'm not waiting around". ✨


And that's the whole page, bestie β€” courtesy of Ericsson AB, with cosEvent 5.2.2 under the hood. Go connect some consumers, slay responsibly, and remember: nil object references don't send texts back. πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from