@@ -177,7 +177,7 @@ def register_namespace(self, namespace_handler):
177
177
namespace_handler
178
178
179
179
def emit (self , event , data = None , room = None , skip_sid = None , namespace = None ,
180
- callback = None ):
180
+ callback = None , ** kwargs ):
181
181
"""Emit a custom event to one or more connected clients.
182
182
183
183
:param event: The event name. It can be any string. The event names
@@ -202,14 +202,22 @@ def emit(self, event, data=None, room=None, skip_sid=None, namespace=None,
202
202
that will be passed to the function are those provided
203
203
by the client. Callback functions can only be used
204
204
when addressing an individual client.
205
+ :param ignore_queue: Only used when a message queue is configured. If
206
+ set to ``True``, the event is emitted to the
207
+ clients directly, without going through the queue.
208
+ This is more efficient, but only works when a
209
+ single server process is used. It is recommended
210
+ to always leave this parameter with its default
211
+ value of ``False``.
205
212
"""
206
213
namespace = namespace or '/'
207
214
self .logger .info ('emitting event "%s" to %s [%s]' , event ,
208
215
room or 'all' , namespace )
209
- self .manager .emit (event , data , namespace , room , skip_sid , callback )
216
+ self .manager .emit (event , data , namespace , room , skip_sid , callback ,
217
+ ** kwargs )
210
218
211
219
def send (self , data , room = None , skip_sid = None , namespace = None ,
212
- callback = None ):
220
+ callback = None , ** kwargs ):
213
221
"""Send a message to one or more connected clients.
214
222
215
223
This function emits an event with the name ``'message'``. Use
@@ -234,8 +242,16 @@ def send(self, data, room=None, skip_sid=None, namespace=None,
234
242
that will be passed to the function are those provided
235
243
by the client. Callback functions can only be used
236
244
when addressing an individual client.
245
+ :param ignore_queue: Only used when a message queue is configured. If
246
+ set to ``True``, the event is emitted to the
247
+ clients directly, without going through the queue.
248
+ This is more efficient, but only works when a
249
+ single server process is used. It is recommended
250
+ to always leave this parameter with its default
251
+ value of ``False``.
237
252
"""
238
- self .emit ('message' , data , room , skip_sid , namespace , callback )
253
+ self .emit ('message' , data , room , skip_sid , namespace , callback ,
254
+ ** kwargs )
239
255
240
256
def enter_room (self , sid , room , namespace = None ):
241
257
"""Enter a room.
0 commit comments