Change user function model to be asynchronous
Add example of main function