title: How to pass socket client connection from nestjs service
body: <p>I want to pass the connected socket client to nest js service. I referred to this question
  <a href="https://stackoverflow.com/questions/70242522/how-to-access-socket-io-client-id-from-controller-nestjs"> https://stackoverflow.com/question....</a>.but I can't understand how to pass the <code>client:Socket</code> from my service.</p>
  <p>I have a bull queue which handles some file processing tasks. once the file processing is completed. I want to notify that to the user who sent that file. below is my WebSocket gateway. In here <code>notifyJobStatus</code> is getting called once the job is done. but I want to send it to a particular client. for that, I need to access the client from my service. then I can modify the method to something like this <code>notifyJobStatus(status: string, client: Socket)</code>.please correct me if this approach is wrong.</p>
  <pre><code>export class NotificationsService
    implements OnGatewayInit, OnGatewayConnection, OnGatewayDisconnect
  {
    @WebSocketServer() server: Server;
    private readonly logger = new Logger(NotificationsService.name);
  
    notifyJobStatus(status: string) {
      //client.broadcast.to(client.id).emit('JobStatus', status);
      this.server.emit('JobStatus', status);
    }
  
    afterInit() {
      this.logger.log('Websocket Server Started,Listening on Port:3006');
    }
  
    handleDisconnect(client: Socket) {
      console.log(`Client disconnected: ${client.id}`);
    }
  
    handleConnection(client: Socket, ...args: any[]) {
      console.log(`Client connected: ${client.id}`);
    }
  }
  </code></pre>