Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Kruse
aura-engine
Commits
119c4017
Commit
119c4017
authored
4 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Ability to resolve channel type. #44
parent
560daecd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/core/channels.py
+19
-0
19 additions, 0 deletions
modules/core/channels.py
with
19 additions
and
0 deletions
modules/core/channels.py
+
19
−
0
View file @
119c4017
...
@@ -131,6 +131,7 @@ class ChannelRouter():
...
@@ -131,6 +131,7 @@ class ChannelRouter():
Args:
Args:
config (AuraConfig): The configuration
config (AuraConfig): The configuration
logger (Logger): The logger
"""
"""
self
.
config
=
config
self
.
config
=
config
self
.
logger
=
logger
self
.
logger
=
logger
...
@@ -167,6 +168,24 @@ class ChannelRouter():
...
@@ -167,6 +168,24 @@ class ChannelRouter():
return
self
.
active_channels
[
channel_type
]
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
else
:
return
None
def
type_for_resource
(
self
,
resource_type
):
def
type_for_resource
(
self
,
resource_type
):
"""
"""
Retrieves a `ChannelType` for the given `ResourceType`.
Retrieves a `ChannelType` for the given `ResourceType`.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment