Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-bigbluebutton2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Service Desk
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
Andreas Grupp
python-bigbluebutton2
Commits
c55303d6
Verified
Commit
c55303d6
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Implement concurrency for group routines
parent
cacd4837
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
bigbluebutton/api/bigbluebutton.py
+25
-7
25 additions, 7 deletions
bigbluebutton/api/bigbluebutton.py
with
25 additions
and
7 deletions
bigbluebutton/api/bigbluebutton.py
+
25
−
7
View file @
c55303d6
import
concurrent.futures
from
dataclasses
import
dataclass
,
field
from
dataclasses
import
dataclass
,
field
from
hashlib
import
sha1
from
hashlib
import
sha1
from
socket
import
getfqdn
from
socket
import
getfqdn
from
typing
import
Dict
,
Optional
,
Sequence
from
typing
import
Any
,
Callable
,
Dict
,
Optional
,
Sequence
from
urllib.parse
import
urlencode
from
urllib.parse
import
urlencode
from
urllib.request
import
urlopen
from
urllib.request
import
urlopen
from
uuid
import
uuid1
from
uuid
import
uuid1
...
@@ -97,19 +98,36 @@ class BigBlueButtonGroup:
...
@@ -97,19 +98,36 @@ class BigBlueButtonGroup:
name
:
str
name
:
str
apis
:
dict
=
field
(
default_factory
=
dict
)
apis
:
dict
=
field
(
default_factory
=
dict
)
workers
:
int
=
10
def
new
(
self
,
name
:
str
,
*
args
,
**
kwargs
)
->
BigBlueButton
:
def
new
(
self
,
name
:
str
,
*
args
,
**
kwargs
)
->
BigBlueButton
:
bbb
=
BigBlueButton
(
self
,
name
,
*
args
,
**
kwargs
)
bbb
=
BigBlueButton
(
self
,
name
,
*
args
,
**
kwargs
)
return
bbb
return
bbb
def
get_meetings
(
self
)
->
Dict
[
str
,
"
Meeting
"
]:
def
_foreach
(
self
,
method
:
str
,
*
args
,
**
kwargs
)
->
Dict
[
str
,
Any
]:
res
=
{}
res
=
{}
for
name
,
bbb
in
self
.
apis
.
items
():
res
.
update
(
bbb
.
get_meetings
())
with
concurrent
.
futures
.
ThreadPoolExecutor
(
max_workers
=
self
.
workers
)
as
pool
:
futures
=
{}
for
name
,
bbb
in
self
.
apis
.
items
():
fn
=
getattr
(
bbb
,
method
)
futures
[
pool
.
submit
(
fn
,
*
args
,
**
kwargs
)]
=
name
for
future
in
concurrent
.
futures
.
as_completed
(
futures
):
name
=
futures
[
future
]
res
[
name
]
=
future
.
result
()
return
res
return
res
def
get_meetings
(
self
)
->
Dict
[
str
,
"
Meeting
"
]:
res
=
self
.
_foreach
(
"
get_meetings
"
)
meetings
=
{}
for
name
in
res
:
meetings
.
update
(
res
[
name
])
return
meetings
def
ssh_command
(
self
,
command
:
Sequence
[
str
],
input
:
Optional
[
str
]
=
None
)
->
Dict
[
str
,
subprocess
.
CompletedProcess
]:
def
ssh_command
(
self
,
command
:
Sequence
[
str
],
input
:
Optional
[
str
]
=
None
)
->
Dict
[
str
,
subprocess
.
CompletedProcess
]:
res
=
{}
res
=
self
.
_foreach
(
"
ssh_command
"
,
command
,
input
)
for
name
,
bbb
in
self
.
apis
.
items
():
res
[
name
]
=
bbb
.
ssh_command
(
command
,
input
)
return
res
return
res
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