kombu.utils.symbol_by_name()
>>> import kombu.utils
>>> kombu.utils.symbol_by_name('argparse')
<module 'argparse' from '/Users/sximada/.anyenv/envs/pyenv/versions/3.4.2/lib/python3.4/argparse.py'>
>>> kombu.utils.symbol_by_name('argparse:ArgumentParser')
<class 'argparse.ArgumentParser'>
celery.utils.instantiate()
>>> import celery.utils
>>> celery.utils.instantiate('argparse:ArgumentParser', description='test')
ArgumentParser(prog='', usage=None, description='test', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
kombu.utils.cached_property()
property cache. It feels like reify.
When using redis, redis.ConnectionPool () is used by default. So the connection timing is created by make_connection () if there are not enough connections at the timing of pool.get_connetion () when getting the connection of redis.
Recommended Posts