用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill babuza-session命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | babuza-session |
| description | | Use when this capability is needed. |
Package:
github.com/fanaujie/babuza/pkg/sessionClient session management for exactly-once semantics and idempotent command execution.
You are an expert at babuza session management. Help users by:
Refer to the local files for detailed API:
./references/session-api.md - Session interfaces, options, and eviction strategies.Select the session management strategy using BabuzaComponentBuilder.
import "github.com/fanaujie/babuza/pkg/builder"
func buildWithSession() *ibabuza.BabuzaComponent {
return builder.NewBabuzaComponentBuilder(&builder.BabuzaComponentConfig{
// Select Session Type: LRUSession, ExpireSession, or NoOpSession
SessionType: builder.LRUSession,
}).Build()
}
Limit the maximum number of concurrent sessions.
import (
"github.com/fanaujie/babuza/pkg/builder"
"github.com/fanaujie/babuza/pkg/session"
)
func buildLruSession() {
builder.NewBabuzaComponentBuilder(&builder.BabuzaComponentConfig{
SessionType: builder.LRUSession,
}).SetSessionOptions(
session.SetLruMgrOptionsWithMaxSessions(256),
).Build()
}
Set the session expiration timeout.
import (
"time"
"github.com/fanaujie/babuza/pkg/builder"
"github.com/fanaujie/babuza/pkg/session"
)
func buildExpireSession() {
builder.NewBabuzaComponentBuilder(&builder.BabuzaComponentConfig{
SessionType: builder.ExpireSession,
}).SetSessionOptions(
session.SetExpiredMgrOptionsWithExpiredTime(time.Hour),
).Build()
}
| Type | Builder Constant | Eviction Strategy | Default |
|---|---|---|---|
| LRU | builder.LRUSession | Evicts least-recently-used when max reached | maxSessions=128 |
| Expire | builder.ExpireSession | Auto-expires after timeout | expiredTime=30min |
| NoOp | builder.NoOpSession | No session tracking | - |
| Scenario | Recommended Type |
|---|---|
| Fixed number of clients | LRU |
| Dynamic/short-lived clients | Expire |
| No idempotency needed | NoOp |
| High-throughput, retry-safe | LRU or Expire |
SequenceNumber to prevent duplicate command execution on retries.RegisterSession before proposing commands.UnregisterSession when a client disconnects to free resources.SequenceNumber, returning cached results for duplicate requests.Converted and distributed by TomeVault — claim your Tome and manage your conversions.