I’m building a shell script that calls various functions. When all functions are done I’d like to close the database connection and exit.
If I could somehow get an event every time an asynchronous job starts and ends I could handle it, but is that possible?
I am confused by your question,
You could use the async module in this way: