[ https://issues.apache.org/jira/browse/MESOS-4253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15099254#comment-15099254 ]
Marco Massenzio commented on MESOS-4253: ---------------------------------------- Sure thing, not a problem. I'd really like to have it in by the 1.0, though - as this is an "externally facing" API (ie, one that external developers code against) it would be awesome to have it stable by then. In particular, I'd love to hear your thoughts about (a) a {{shutdown()}} method (naming TBD, this would be consistent with the current naming for frameworks; although, {{finalize()}} may be more appropriate); and (b) whether we should also "fix" (most likely in a different Jira/RR) the fact that currently the module pointers are never deallocated in the {{main()}} methods, so the class destructors are never called (AFAICT, anyway). Thanks! > Provide a minimalist "runtime context" to an Anonymous Module > ------------------------------------------------------------- > > Key: MESOS-4253 > URL: https://issues.apache.org/jira/browse/MESOS-4253 > Project: Mesos > Issue Type: Improvement > Components: modules > Reporter: Marco Massenzio > Assignee: Marco Massenzio > > Currently, {{Anonymous}} modules only receive at creation a copy of the > {{"parameters"}} passed in the JSON configuration file. > However, at runtime, it would be useful to also have a "runtime context" for > the module developer to use, when implementing the functionality. > I would suggest to pass in the {{Flags}} object from the Master/Agent inside > an {{setRuntimeContext(const Flags&)}}[0] method, called immediately > post-{{create(const Parameters&)}}[1]. > Also, I would suggest adding a {{teardown()}} method too, in case the module > needs to release resources / conduct cleanup before exiting (there is a TODO > in the code to this effect, and adding this in this patch would be close to > trivial). > [0] In practice, it won't be this trivial, as Master/Agent {{Flags}} are of a > different compile-time type - probably use something like variadic templates > or something (suggestions appreciated!). > [1] In fact, the ideal solution would be to add the {{const Flags&}} to > {{create()}}, but that would, alas, break everyone's modules; so that's > probably a no-go (ideas welcome here too). -- This message was sent by Atlassian JIRA (v6.3.4#6332)