'Serializes the instance and sends it to all provided group names.'

def send_messages(self, instance, group_names, action, **kwargs):

    if (not group_names):
        return
    self.signal_kwargs = kwargs
    payload = self.serialize(instance, action)
    if (payload == {}):
        return
    assert (self.stream is not None)
    message = self.encode(self.stream, payload)
    for group_name in group_names:
        group = Group(group_name)
        group.send(message)
