forked from noxious/server
17 lines
461 B
TypeScript
17 lines
461 B
TypeScript
import { Server as SocketServer } from 'socket.io'
|
|
|
|
import { TSocket } from '#application/types'
|
|
|
|
export default class SomeJob {
|
|
constructor(private params: any) {}
|
|
|
|
async execute(io: SocketServer, socket?: TSocket) {
|
|
// Handle the event
|
|
if (socket) {
|
|
socket.emit('notification', { message: 'Something happened with socket' })
|
|
}
|
|
// Use io for broadcasting if needed
|
|
io.emit('notification', { message: 'Something happened' })
|
|
}
|
|
}
|