Same as get method but its native coroutine.

        Usage example:

        >>> async for msg in ch.iter():
        ...     print(msg)
160737
def iter(self, *, encoding=None, decoder=None):
        
        return _IterHelper(self,
                           is_active=lambda ch: ch.is_active,
                           encoding=encoding,
                           decoder=decoder)
1190395
def async_get(self, handle):
        '''  '''
        assert handle in self._thread_pool, 'Invalid async call handle'
        result = self._thread_pool[handle].result_queue.get()
        del self._thread_pool[handle]
        return result
831307
def _print_message(self, text, fd=None):
        '''
        
        '''
        # Since we have the async->sync->async problem, queue up and print at exit
        self.root.mesgs.extend(text.split('\n'))
1211767
def dump(self, **kwargs):
        import sys
        ''''''
        if not self.seq:
            self.seq = self.getSequence()
        print("StringGenerator version: %s" % (__version__))
        print("Python version: %s" % sys.version)
        # this doesn't work anymore in p3
        # print("Random method provider class: %s" % randint.im_class.__name__)
        self.seq.dump()
        return self.render(**kwargs)
12988
async def _process_msgs(self):
        
        while True:
            args = await self._msgq.get()
            _LOGGER.debug('Processing: %s %02x %s %s %s', args[0], args[1],
                          *[args[i].hex() for i in range(2, 5)])
            await self._process_msg(*args)
711590
public static void printOnce(Object msg) {
		if (messagesCache.get(msg.hashCode()) == null) {
			JK.printBlock(msg);
			messagesCache.put(msg.hashCode(), msg);
		}
	}
1315056
def _peek_async_request(self, msg_id, msg_name):
        
        assert get_thread_ident() == self.ioloop_thread_id
        if msg_id is None:
            msg_id = self._msg_id_for_name(msg_name)
        if msg_id in self._async_queue:
            return self._async_queue[msg_id]
        else:
            return None, None, None, None, None
1351124
def echo(topic_name, num_print=None, out=sys.stdout, host=jps.env.get_master_host(), sub_port=jps.DEFAULT_SUB_PORT):
    '''
    '''
    class PrintWithCount(object):

        def __init__(self, out):
            self._printed = 0
            self._out = out

        def print_and_increment(self, msg):
            self._out.write('{}\n'.format(msg))
            self._printed += 1

        def get_count(self):
            return self._printed

    counter = PrintWithCount(out)
    sub = jps.Subscriber(
        topic_name, counter.print_and_increment, host=host, sub_port=sub_port)
    try:
        while num_print is None or counter.get_count() < num_print:
            sub.spin_once()
            time.sleep(0.0001)
    except KeyboardInterrupt:
        pass
377673
async def anext(self):
        """"""
        try:
            f = next(self._iter)
        except StopIteration as exc:
            raise StopAsyncIteration() from exc
        return await f
1323587
def _get_coroutine(self, request, start_response):
        ''''''
        adapter = self.url_map.bind_to_environ(request.environ)
        resource, kwargs = adapter.match()
        callback = self.callback_map[resource]
        inject_extra_args(callback, request, kwargs)
        return callback(request, start_response, **kwargs)
722929
def _get_results(FetcherClass, services, kwargs, num_results=None, fast=0, verbose=False, timeout=None):
    
    results = []

    if not num_results or fast:
        num_results = len(services)

    with futures.ThreadPoolExecutor(max_workers=len(services)) as executor:
        fetches = {}
        for service in services[:num_results]:
            tail = [x for x in services if x is not service]
            random.shuffle(tail)
            srv = FetcherClass(services=[service] + tail, verbose=verbose, timeout=timeout)
            fetches[executor.submit(srv.action, **kwargs)] = srv

        if fast == 1:
            raise NotImplementedError
            # ths code is a work in progress. futures.FIRST_COMPLETED works differently than I thought...
            to_iterate, still_going = futures.wait(fetches, return_when=futures.FIRST_COMPLETED)
            for x in still_going:
                try:
                    x.result(timeout=1.001)
                except futures._base.TimeoutError:
                    pass

        elif fast > 1:
            raise Exception("fast level greater than 1 not yet implemented")
        else:
            to_iterate = futures.as_completed(fetches)

        for future in to_iterate:
            service = fetches[future]
            results.append([service, future.result()])

    return results
392820
def results(self, *args, **kwargs):
        
        def worker():
            kwargs['page'] = 1
            while True:
                response = self.client(*args, **kwargs)
                if isinstance(response, list):
                    yield response
                    break
                elif _is_page(response):
                    yield response['results']
                    if response['next']:
                        kwargs['page'] += 1
                    else:
                        break
                else:
                    raise NoResultsError(response)

        return itertools.chain.from_iterable(worker())
753296
def run(self):
        
        for line in self.incoming:
            message = loads(line)
            result = self._evaluate(message)
            if result is self._SKIP:
                continue
            self.output.write(dumps(result, cls=_DatetimeJSONEncoder) + b"\n")
842932
def _bg(self, coro: coroutine) -> asyncio.Task:
        """"""
        async def runner():
            try:
                await coro
            except:
                self._log.exception("async: Coroutine raised exception")
        return asyncio.ensure_future(runner())
474357
function SingleLine()
{
    SingleLine.prototype.print = function(msg)
    {
        var result = check();
        if (result.success)
        {
            process.stdout.clearLine();
            process.stdout.cursorTo(0);
            process.stdout.write(msg);
        }
        else
            MultiLine.prototype.print('missed method: ' + result.required_method + ' ' + msg);
    };

    SingleLine.prototype.info = function(msg)
    {
        this.parse_and_print(arguments, GREEN);
    };

    SingleLine.prototype.mark = function(msg)
    {
        this.parse_and_print(arguments, LIGHT_GREEN);
    };

    SingleLine.prototype.error = function(msg)
    {
        this.parse_and_print(arguments, RED);
    };

    SingleLine.prototype.warn = function(msg)
    {
        this.parse_and_print(arguments, YELLOW);
    };

    function check()
    {
        var check = ['clearLine', 'cursorTo', 'write'];
        for (var i = 0; i < check.length; i++)
        {
            var method = check[i];
            if (!(method in process.stdout))
                return {required_method: method};
        }
        return {success: true};
    }
}
627610
async def async_input(prompt):
    
    print(prompt, end='', flush=True)
    return (await loop.run_in_executor(None, sys.stdin.readline)).rstrip()
70256
def coroutine(func):
    
    def wrapper(*args, **kwargs):
        gen = func(*args, **kwargs)
        val = next(gen)
        if val != None:
            raise TypeError('Unexpected value from start of coroutine')
        return gen
    wrapper.__name__ = func.__name__
    wrapper.__doc__ = func.__doc__
    return wrapper