My vote would be #2 as well.
> On May 6, 2016, at 11:29 AM, marko kiiskila <ma...@runtime.io> wrote: > > Hi, > >> On May 5, 2016, at 10:47 AM, Sterling Hughes <sterl...@apache.org> wrote: >> >> Salutations, >> >> As I've been going through the callout implementation, one thing I've >> noticed is that callouts and callout_funcs can't be interleaved. >> >> The implementation of a callout, is that it has an event as the first >> element of the structure. When that event is posted to an event queue, it >> is posted with the event type EVENT_T_TIMER, which is reserved for callouts. >> However, you must know a priori what type of callout it is, a callout, or a >> callout_func. >> >> I don't think this behavior is ideal, and there are a couple of options for >> fixing it: >> >> 1- Break out EVENT_T_TIMER into EVENT_T_TIMER (callout) and >> EVENT_T_TIMER_FUNC (callout_func). >> >> 2- Remove the concept of callout, and just have callout_func. callout_func >> is by far the more useful of the two. >> >> 3- Add a flags field to callout, which will tell you whether its a callout >> or a callout_func. >> >> I'm leaning towards either #2 or #3 here, because I think the first one will >> end up being confusing when debugging things. "Oh no, I put TIMER instead >> of TIMER_FUNC. GRR." My personal preference is #2, but I'm not sure >> everyone wants to be forced to have a function per-timer in their task >> context. >> >> Thoughts? > > I would prefer #2, as that would simplify the concept. > > Also, while you have that file cracked open, cf_arg from within > os_callout_func could be removed. > os_callout includes os_event, and that structure already has a void * which > could be used as callout_func > argument. > — > M