worker.isConnected()
如果工作线程通过其 IPC 通道连接到主线程,则此函数返回 true,否则返回 false。工作线程在创建后会连接到主线程。在 'disconnect' 事件触发后,它会断开连接。
【This function returns true if the worker is connected to its primary via its
IPC channel, false otherwise. A worker is connected to its primary after it
has been created. It is disconnected after the 'disconnect' event is emitted.】