Skip to content

Async persister interface #484

Open
Open
@elijahbenizzy

Description

@elijahbenizzy

Is your feature request related to a problem? Please describe.
The current persister interface is synchronous. This can cause performance issues in asynchronous code.

Describe the solution you'd like
We should have a separate stack for asynchronous persistence -- ideally with modes for either (1) fire-and-forget or (2) blocking/transactional (depends on how consistent the user wants it -- this part might be general persister configuration, rather than async-specific).

To dig in, we will need:

  • Persistence interfaces for this (BaseStateLoader, BaseStateSaver, PersisterHook) -- each converted to async
  • A few default implementations (SQLLite, redis? TBD -- go with the easy ones on this)
  • Integrations with application
    • asynchronous build() method in application builder (.abuild()) - or maybe another builder? Guess is we want an asynchronous build method
    • validation in .run() -- E.G. if you have async hooks they will not be called -- at least a warning message if not an error
  • Comprehensive testing for ^^^
  • Think through integration with parallel actions --- will want an acreate_app here.

Describe alternatives you've considered

Could have synchronous fire/forget mode, although we very likely want something transactional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions