Passing parameters to scheduled handlerMethods

What’s the correct way to pass parameters to scheduled handleMethods?

As an illustration, I’m trying to do something like this:

def onHandler(evt) {
    def scheduledAt = now()
    runIn( 10, someHandler(scheduledAt) )
}

def someHandler(scheduledAt) {
    log.debug "I was scheduled at $scheduledAt"
}

When called like this, someHandler is called immediately. In this example an error is generated because runIn is expecting someHandler to return the name of a function to run.

I get similar behavior when trying to pass a closure to runIn, except then I get a “No signature of method” error.

Thanks for your help,
Gary

Honestly I’ve just been making custom functions that do what I need. Not really my preferred method of doing things, but I haven’t seen a better way yet.

Yeah, I have a workable solution, but I’m looking for that better way! :slight_smile: