I've created a plugin, and it has a function that takes two args, like so:
... would this work? :
add_action ( 'publish_post', process($tokens, $payloads) );
No, this cannot work. Haven't you tested your idea?
A simple workaround would be a class: