In lines 42 and 47 there are posted messages.
But these messages do not have a command
field as required by the handlers in lines 5-23.
So I don't understand how these messages are handled. Please explain.
In lines 42 and 47 there are posted messages.
But these messages do not have a command
field as required by the handlers in lines 5-23.
So I don't understand how these messages are handled. Please explain.
Copyright © 2021 Jogjafile Inc.
Those messages are sent to the main thread, not the worker itself. They represent results. That function doesn’t handle any of those outgoing messages. It only handles incoming messages. That’s what a function listening for
message
events does.For example: