0.0
The project is in a healthy, maintained state
Provides immutable session records, event envelopes, an in-memory store with concurrency guardrails, a durable provider-backed store for restart-safe sessions, a replayable host with subscriptions, a runtime tool-lifecycle sink, and a state reducer that reconstructs session snapshots from event history.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 5.25
~> 13.0
 Project Readme

Ask::Session

Event-sourced session state for the ask-rb ecosystem.

Overview

Ask::Session provides the foundational value objects and stores for event-sourced session management in ask-rb: immutable Record and Event envelopes, an in-memory Store with concurrency guardrails, a durable ProviderStore for restart-safe sessions, a replayable Host with subscriptions, a State reducer, and a Sink that records ask-runtime tool lifecycle through Host#sink. It ships with zero runtime dependencies — durability through ask-state-providers is an optional integration.

Task guides live in docs/.

Installation

Requires Ruby 3.2+.

gem "ask-session"

Quick start

In-memory, single process:

require "ask-session"

host = Ask::Session::Host.new

host.create(id: "s1", metadata: { user: "alice" })
host.send_message("s1", content: "hello")
host.session("s1").version # => 2
host.close("s1", reason: "done")

Invalid transitions (sending to a closed session, closing twice) raise Ask::Session::InvalidTransitionError.

Guides

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-feature)
  3. Commit your changes (git commit -am 'Add feature')
  4. Push to the branch (git push origin my-feature)
  5. Create a Pull Request

License

MIT License. See LICENSE for details.