This document is for Kombu's development version, which can be significantly different from previous releases. Get the stable docs here: 3.0.
Source code for kombu.async.aws.sqs
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from kombu.async.aws.ext import boto, get_regions
from .connection import AsyncSQSConnection
__all__ = ['regions', 'connect_to_region']
[docs]def regions():
"""Return list of known AWS regions."""
if boto is None:
raise ImportError('boto is not installed')
return get_regions('sqs', connection_cls=AsyncSQSConnection)
[docs]def connect_to_region(region_name, **kwargs):
"""Connect to specific AWS region."""
for region in regions():
if region.name == region_name:
return region.connect(**kwargs)