Dedicated workers can communicate with their spawning script, listening to certain events which trigger when either of the scripts sends/receives a message.
These events can be handled in both scripts (worker and main script) using certain event handlers. Let us learn how to achieve that.