Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Commits
8e1e60e3
Commit
8e1e60e3
authored
4 years ago
by
Nathan Hertz
Browse files
Options
Downloads
Patches
Plain Diff
Added some documentation
parent
8cb9263b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
shared/channels/src/channels/amqp_helpers.py
+10
-0
10 additions, 0 deletions
shared/channels/src/channels/amqp_helpers.py
with
10 additions
and
0 deletions
shared/channels/src/channels/amqp_helpers.py
+
10
−
0
View file @
8e1e60e3
"""
File that contains a collection of helper functions that provide easy access to common AMQP functions, such as
opening and closing connections and channels, sending events, and listening for events
"""
import
json
from
abc
import
ABC
,
abstractmethod
from
typing
import
Callable
,
Any
,
Optional
,
Union
,
TypeVar
,
Protocol
,
Generic
...
...
@@ -16,6 +20,9 @@ CONN = None
class
ChannelDefinition
(
Protocol
[
T
]):
"""
Abstract implementation of an AMQP channel
"""
@abstractmethod
def
routing_key_for
(
self
,
message
:
T
)
->
str
:
pass
...
...
@@ -35,6 +42,9 @@ class ChannelDefinition(Protocol[T]):
class
WorkflowEventChannel
(
ChannelDefinition
[
WorkflowEvent
]):
"""
Class that represents an AMQP channel connected to the Workflow Service exchange
"""
EXCHANGE
=
"
workspaces.workflow-service.workflow-status
"
def
schema
(
self
)
->
Schema
:
...
...
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