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
35b5c4ba
Commit
35b5c4ba
authored
9 years ago
by
Mark Haines
Browse files
Options
Downloads
Patches
Plain Diff
use google style doc strings
parent
a2866e2e
Branches
Branches containing commit
Tags
v1.126.0rc2
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/util/id_generators.py
+12
-11
12 additions, 11 deletions
synapse/storage/util/id_generators.py
with
12 additions
and
11 deletions
synapse/storage/util/id_generators.py
+
12
−
11
View file @
35b5c4ba
...
@@ -49,17 +49,18 @@ class StreamIdGenerator(object):
...
@@ -49,17 +49,18 @@ class StreamIdGenerator(object):
all ids less than or equal to it have completed. This handles the fact that
all ids less than or equal to it have completed. This handles the fact that
persistence of events can complete out of order.
persistence of events can complete out of order.
:param connection db_conn: A database connection to use to fetch the
Args:
initial value of the generator from.
db_conn(connection): A database connection to use to fetch the
:param str table: A database table to read the initial value of the id
initial value of the generator from.
generator from.
table(str): A database table to read the initial value of the id
:param str column: The column of the database table to read the initial
generator from.
value from the id generator from.
column(str): The column of the database table to read the initial
:param list extra_tables: List of pairs of database tables and columns to
value from the id generator from.
use to source the initial value of the generator from. The value with
extra_tables(list): List of pairs of database tables and columns to
the largest magnitude is used.
use to source the initial value of the generator from. The value
:param int step: which direction the stream ids grow in. +1 to grow
with the largest magnitude is used.
upwards, -1 to grow downwards.
step(int): which direction the stream ids grow in. +1 to grow
upwards, -1 to grow downwards.
Usage:
Usage:
with stream_id_gen.get_next() as stream_id:
with stream_id_gen.get_next() as stream_id:
...
...
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