[ 
https://issues.apache.org/jira/browse/MESOS-4253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15072372#comment-15072372
 ] 

Marco Massenzio commented on MESOS-4253:
----------------------------------------

[~karya] - would you mind terribly shepherding this one, please?

> 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)

Reply via email to