Unit Of Work#

Important

The synchronous version is generated from the async version

Async#

Unit of work

class purgatory.service._async.unit_of_work.AsyncAbstractUnitOfWork#
contexts: purgatory.service._async.repository.AsyncAbstractRepository#
collect_new_events() Generator[purgatory.domain.messages.base.Message, None, None]#
async initialize() None#

Override to initialize repositories.

abstract async commit() None#

Commit the transation.

abstract async rollback() None#

Rollback the transation.

class purgatory.service._async.unit_of_work.AsyncInMemoryUnitOfWork#
contexts: purgatory.service._async.repository.AsyncAbstractRepository#
async commit() None#

Do nothing.

async rollback() None#

Do nothing.

class purgatory.service._async.unit_of_work.AsyncRedisUnitOfWork(url: str)#
contexts: purgatory.service._async.repository.AsyncAbstractRepository#
async initialize() None#

Override to initialize repositories.

async commit() None#

Do nothing.

async rollback() None#

Do nothing.

Sync#

Unit of work

class purgatory.service._sync.unit_of_work.SyncAbstractUnitOfWork#
contexts: purgatory.service._sync.repository.SyncAbstractRepository#
collect_new_events() Generator[purgatory.domain.messages.base.Message, None, None]#
initialize() None#

Override to initialize repositories.

abstract commit() None#

Commit the transation.

abstract rollback() None#

Rollback the transation.

class purgatory.service._sync.unit_of_work.SyncInMemoryUnitOfWork#
contexts: purgatory.service._sync.repository.SyncAbstractRepository#
commit() None#

Do nothing.

rollback() None#

Do nothing.

class purgatory.service._sync.unit_of_work.SyncRedisUnitOfWork(url: str)#
contexts: purgatory.service._sync.repository.SyncAbstractRepository#
initialize() None#

Override to initialize repositories.

commit() None#

Do nothing.

rollback() None#

Do nothing.