def send(key, *args):

    # Get the list of requests listening for key. If there aren't any, return.
    recv = receivers.pop(key, None)
    if not recv:
        return

    # If we only have one argument, pop it out of its tuple.
    if len(args) == 1:
        args = args[0]

    # Now, for each listening request, make sure it's still alive before
    # sending the arguments its way.
    for ref in recv:
        request = ref()
        if not request:
            continue

        # Check for the _in_do attribute, to make sure the request is still
        # working asynchronously.
        if not hasattr(request, "_in_do"):
            continue

        # Get the top of the request's wait list and make sure it's what
        # we expect.
        if not request._waiting or not isinstance(request._waiting[-1], _Receiver):
            continue

        # Pop the top item off the wait list and clear any timeout.
        top = request._waiting.pop()
        if callable(top.timeout):
            top.timeout()

        # Now, send the message.
        _do(request, args)
Send a message with the provided ``*args`` to all asynchronous requests
dataset/ETHPy150Open ecdavis/pants/pants/web/asynchronous.py/send