def METHOD_NAME(
        self,
        message_type: 'WSMessageType',
        to_send_data: Union[dict[str, Any], list[Any]],
        success_callback: Optional[Callable] = None,
        success_callback_args: Optional[dict[str, Any]] = None,
        failure_callback: Optional[Callable] = None,
        failure_callback_args: Optional[dict[str, Any]] = None,
) -> None:
    """Broadcasts a websocket message
    A callback to run on message success and a callback to run on message
    failure can be optionally provided.
    """
    message_data = {'type': str(message_type), 'data': to_send_data}
    try:
        message = json.dumps(message_data)
    except TypeError as e:
        log.error(f'Failed to broadcast websocket {message_type} message due to {e!s}')
        if failure_callback is not None:
            failure_callback_args = {} if failure_callback_args is None else failure_callback_args  # noqa: E501
            failure_callback(**failure_callback_args)
        return  # get out of the broadcast
    to_remove_indices = set()
    spawned_one_broadcast = False
    for idx, websocket in enumerate(self.subscribers):
        if websocket.closed is True:
            to_remove_indices.add(idx)
            continue
        _ws_send_impl(
            websocket=websocket,
            lock=self.locks[websocket],
            to_send_msg=message,
            success_callback=success_callback,
            success_callback_args=success_callback_args,
            failure_callback=failure_callback,
            failure_callback_args=failure_callback_args,
        )
        spawned_one_broadcast = True
    if len(to_remove_indices) != 0:  # removed closed websockets from the list
        self.subscribers = [
            i for j, i in enumerate(self.subscribers) if j not in to_remove_indices
        ]
    if spawned_one_broadcast is False and failure_callback is not None:
        failure_callback_args = {} if failure_callback_args is None else failure_callback_args  # noqa: E501
        failure_callback(**failure_callback_args)