Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
8af9f11b
Commit
8af9f11b
authored
5 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
make FederationClient.send_join async
parent
3f11cbb4
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
synapse/federation/federation_client.py
+13
-11
13 additions, 11 deletions
synapse/federation/federation_client.py
with
13 additions
and
11 deletions
synapse/federation/federation_client.py
+
13
−
11
View file @
8af9f11b
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
import
copy
import
copy
import
itertools
import
itertools
import
logging
import
logging
from
typing
import
Dict
,
Iterable
,
List
,
Optional
,
Tuple
from
typing
import
Any
,
Dict
,
Iterable
,
List
,
Optional
,
Tuple
from
prometheus_client
import
Counter
from
prometheus_client
import
Counter
...
@@ -496,27 +496,29 @@ class FederationClient(FederationBase):
...
@@ -496,27 +496,29 @@ class FederationClient(FederationBase):
"
make_
"
+
membership
,
destinations
,
send_request
"
make_
"
+
membership
,
destinations
,
send_request
)
)
def
send_join
(
self
,
destinations
,
pdu
,
event_format_version
):
async
def
send_join
(
self
,
destinations
:
Iterable
[
str
],
pdu
:
EventBase
,
event_format_version
:
int
)
->
Dict
[
str
,
Any
]:
"""
Sends a join event to one of a list of homeservers.
"""
Sends a join event to one of a list of homeservers.
Doing so will cause the remote server to add the event to the graph,
Doing so will cause the remote server to add the event to the graph,
and send the event out to the rest of the federation.
and send the event out to the rest of the federation.
Args:
Args:
destinations
(str)
: Candidate homeservers which are probably
destinations: Candidate homeservers which are probably
participating in the room.
participating in the room.
pdu
(BaseEvent)
: event to be sent
pdu: event to be sent
event_format_version
(int)
: The event format version
event_format_version: The event format version
Return:
Return
s
:
Deferred: resolves to
a dict with members ``origin`` (a string
a dict with members ``origin`` (a string
giving the serer the event was sent to, ``state`` (?) and
giving the serer the event was sent to, ``state`` (?) and
``auth_chain``.
``auth_chain``.
Fails with a ``SynapseError`` if the chosen remote server
Raises:
returns a 300/400 code.
SynapseError: if the chosen remote server
returns a 300/400 code.
Fails with a ``
RuntimeError
``
if no servers were reachable.
RuntimeError
:
if no servers were reachable.
"""
"""
def
check_authchain_validity
(
signed_auth_chain
):
def
check_authchain_validity
(
signed_auth_chain
):
...
@@ -603,7 +605,7 @@ class FederationClient(FederationBase):
...
@@ -603,7 +605,7 @@ class FederationClient(FederationBase):
"
origin
"
:
destination
,
"
origin
"
:
destination
,
}
}
return
self
.
_try_destination_list
(
"
send_join
"
,
destinations
,
send_request
)
return
await
self
.
_try_destination_list
(
"
send_join
"
,
destinations
,
send_request
)
@defer.inlineCallbacks
@defer.inlineCallbacks
def
_do_send_join
(
self
,
destination
,
pdu
):
def
_do_send_join
(
self
,
destination
,
pdu
):
...
...
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