Can I pass arguments to the callback with add_next_tick_callback?

Hi,

looking for a way to pass (named) arguments to the add_next_tick_callback function.

def work(a,b=5):
    C = a+b

doc.add_next_tick_callback(work, ???)

Keep getting errors like add_next_tick_callback() takes 2 positional arguments but 3 were given and found noting in docs.

Thanks

You can use the Python standard library functools.partial to “bake in” extra parameters before passing to add_next_tick_callback.