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.