Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 602 Bytes

docs.rst

File metadata and controls

23 lines (16 loc) · 602 Bytes

Documentation

s3m

Using with statement

The Connection (as well as Cursor) object supports the with statement. It acquires the locks which will result either in the current thread waiting for other threads or making other threads wait until the current thread exits the with block.

conn = s3m.connect("database.db", ...)
...

with conn: # This blocks other threads
    conn.execute(<something>)
    conn.execute(<something else>)

# The other threads are no longer blocked