postMessage

fun postMessage(message: Any?, transfer: ReadonlyArray<MessagePortMain> = definedExternally)(source)

Send a message to the child process, optionally transferring ownership of zero or more MessagePortMain objects.

For example: