COSTIMEREVENT_TIMEREVENTHANDLER(3erl)

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

✨ NAME ✨

CosTimerEvent_TimerEventHandler β€” bestie, this module is the whole implementation of the OMG CosTimerEvent::TimerEventHandler interface. that's it, that's the name, iconic πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so before you can even look at the record definitions for the structures, you gotta pull them in like this:

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

that's the entry fee. no include, no records, no vibes. πŸŽ€


πŸ‘‘ EXPORTS πŸ‘‘

🌸 '_get_status'(TimerEventHandler) -> Reply

Types:

TimerEventHandler = #objref
Reply = 'ESTimeSet' | 'ESTimeCleared' | 'ESTriggered' | 'ESFailedTrigger'

this op literally just hands you back the status of the target object. no notes. here's the tea on each possible reply:

  • 'ESTimeSet' β€” the timer is set and it will trigger event(s). she's ready. πŸ’–
  • 'ESTimeCleared' β€” either no time was ever set, or the timer got reset. nothing pending, bestie.
  • 'ESTriggered' β€” the event has already been sent. done. ate. ✨
  • 'ESFailedTrigger' β€” it tried to send the event and it failed. it's giving 😭 energy fr fr.
heads up: if the target object is of type 'TTPeriodic', then the status value 'ESTriggered' is not valid. don't come for me, that's just how it is 🫢

🌸 time_set(TimerEventHandler) -> Reply

Types:

TimerEventHandler = #objref
Reply = {boolean(), UTO}
UTO = #objref

this one returns true if the time has actually been set for an event that hasn't been triggered yet β€” and false if it hasn't. the outparameter is the current time value of the target object. so like, a boolean and a lil time receipt. obsessed. 🌈


🌸 set_timer(TimerEventHandler, TimeType, TriggerTime) -> void()

Types:

TimerEventHandler = #objref
TimeType = 'TTAbsolute' | 'TTRelative' | 'TTPeriodic'
TriggerTime = UTO
UTO = #objref

this operation terminates any previously set trigger (bye bestie πŸ‘‹) and sets a brand new trigger, specified by the TimeType and the UTO objects. and now the important part β€” the relationship between the UTO object and the TimeTypes:

  • 'TTAbsolute' β€” the UTO object must represent absolute time, i.e., the number of 100 nanoseconds passed since 15 october 1582 00:00. yes really, that specific. no cap. ⭐
  • 'TTRelative' β€” the UTO object must represent the span from now until whenever the event should be triggered, e.g., within 30*10^7 nanoseconds.
  • 'TTPeriodic' β€” same deal as 'TTRelative', BUT this option will trigger an event periodically until the timer gets cancelled. she keeps going. main character energy, she does not stop πŸ’€

🌸 cancel_timer(TimerEventHandler) -> boolean()

Types:

TimerEventHandler = #objref

this operation cancels the triggering of event(s), if possible. it returns true if an event is actually cancelled, and false otherwise. so like, sometimes she can, sometimes she can't, and she'll tell you which πŸ™ˆ


🌸 set_data(TimerEventHandler, EventData) -> ok

Types:

TimerEventHandler = #objref
EventData = #any

this operation changes the event data that gets sent when triggered. that's the whole thing. short, sweet, slays. πŸ“


and that's the whole page, bestie!! this was Ericsson AB, cosTime 5.2.2, and if you peek at the footer it says CosTimerEv...ventHandler(3) β€” the name got cut off but we know who she is πŸ’œ mwah, go set some timers, ily 🧚✨

πŸ“¦ where this page comes from