Commit 119c4017 authored by David Trattnig's avatar David Trattnig
Browse files

Ability to resolve channel type. #44

parent 560daecd
......@@ -131,6 +131,7 @@ class ChannelRouter():
config (AuraConfig): The configuration
logger (Logger): The logger
self.config = config
self.logger = logger
......@@ -167,6 +168,24 @@ class ChannelRouter():
return self.active_channels[channel_type]
def type_of_channel(self, channel):
Retrieves a `ChannelType` for the given `Channel`.
if channel in ChannelType.QUEUE.channels:
return ChannelType.QUEUE
elif channel in ChannelType.FALLBACK_QUEUE.channels:
return ChannelType.FALLBACK_QUEUE
elif channel in ChannelType.HTTP.channels:
return ChannelType.HTTP
elif channel in ChannelType.HTTPS.channels:
return ChannelType.HTTPS
elif channel in ChannelType.LIVE.channels:
return ChannelType.LIVE
return None
def type_for_resource(self, resource_type):
Retrieves a `ChannelType` for the given `ResourceType`.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment