Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Python Briar Wrapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
briar
Python Briar Wrapper
Commits
c25e5d1b
Commit
c25e5d1b
authored
4 years ago
by
Nico
Browse files
Options
Downloads
Patches
Plain Diff
Make it possible to disconnect from socket listener signals
Related to
briar-gtk#44
and
briar-gtk#45
.
parent
94861a3a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#4292
passed
4 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar_wrapper/models/socket_listener.py
+8
-0
8 additions, 0 deletions
briar_wrapper/models/socket_listener.py
with
8 additions
and
0 deletions
briar_wrapper/models/socket_listener.py
+
8
−
0
View file @
c25e5d1b
...
...
@@ -27,6 +27,11 @@ class SocketListener(): # pylint: disable=too-few-public-methods
self
.
_signals_lock
.
release
()
return
signal_id
def
disconnect
(
self
,
signal_id
):
self
.
_signals_lock
.
acquire
()
self
.
_remove_signal
(
signal_id
)
self
.
_signals_lock
.
release
()
def
_add_signal
(
self
,
event
,
callback
):
self
.
_highest_signal_id
+=
1
signal_id
=
self
.
_highest_signal_id
...
...
@@ -36,6 +41,9 @@ class SocketListener(): # pylint: disable=too-few-public-methods
}
return
signal_id
def
_remove_signal
(
self
,
signal_id
):
del
self
.
_signals
[
signal_id
]
def
_start_websocket_thread
(
self
):
websocket_thread
=
Thread
(
target
=
self
.
_start_watch_loop
,
daemon
=
True
)
...
...
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