Skip to content

v0.1.0

Latest
Compare
Choose a tag to compare
@cablehead cablehead released this 06 Dec 21:11
· 11 commits to main since this release

Highlights

A Major Rework of Handlers

https://github.com/cablehead/xs/wiki/Handlers

  • Prior to this release, handlers had virtually no error handling. Now, when an error occurs, handlers will unregister themselves and record the error in the unregister frame's metadata.
  • The handlers closure shape is now {|frame, state| ... }, meaning the frame is passed as an argument instead of being supplied as $in.
  • Treatment of return values has been normalized: there is no longer any difference between handler return values for stateful and stateless handlers. By default, non-empty return values are appended as <handler>.out (previously it was just <handler>).
  • You can configure the return value suffix and TTL using the return_options in the metadata of the handler registration frame.
  • .append calls from a handler are now batched and processed together after the handler successfully completes. They aren't yet emitted in a fjall atomic batch but will be in the future. handler_id, frame_id, and state_id (if there is state) are now automatically included in the metadata of these appended frames.
  • Stateful handlers now communicate state updates by appending a <handler>.state frame.
  • A handy trick is to set the return value suffix to .state: then your return value will become the next state value for the subsequent handler call.

Miscellaneous

  • You can now import from one store into another: https://github.com/cablehead/xs/wiki/Export-and-Import
  • The CLI client can now access stores behind HTTPS and BasicAuth
  • Two new TTL options for frames:
    • time:<milliseconds>: the frame will exist for the specified number of milliseconds
    • head:<count>: keeps the most recent count frames for a given topic; among other uses, this is useful for using xs as a KV store

Breaking Changes

  • See handlers notes above
  • fjall dependency has been upgraded from 1.5 to 2.4
  • $env.XSPWD has been renamed to $env.XS_ADDR
  • xs pipe has been renamed to xs process -- .pipe -> .process

Raw commit messages:

  • 4d983f3 docs: add --locked to the cargo install instructions πŸ™ @fdncred
  • 2d840a8 rename $env.XSPWD to $env.XS_ADDR
  • e02edab feat: add a version endpoint; bump version in toml to 0.1.0
  • 96c482b feat: add conveniences to dump and load a store
  • a190163 feat: add frame import endpoint for backup/restore operations
  • 6b5b51f feat: add xs cas-post: which inserts content into the CAS without needing to insert a corresponding frame
  • ca9b5bf s/postfix/suffix/g -- πŸ™ @marvin-j97
  • 1fa2678 feat: lots and lots of work on handlers (#28)
  • 0c9e689 tuning: use less (lsm) threads πŸ™ @marvin-j97 (#27)
  • ecf1e2e fix: update the example handlers to take frame as an argument
  • 5ab960b fix(handlers): ignore unregistered handlers on startup
  • 5f07a3a feat(handlers): validate closure shape and emit .unregister on registration error
  • f4f01f3 refactor: rename HandlerMeta to Meta, reuse Handler for /process endpoint
  • c5a0390 refactor: rename pipe to process
  • ee6193c refactor(handlers): pass frame/state as args instead of pipeline, encapsulate eval
  • ea648e9 refactor(handlers): split handlers.rs into module with handler and serve
  • 5907db4 fix: only include expose in xs.start meta when expose option is set
  • abe717f fix: pull TTL into its own module: bring nu/commands/append_command.rs up to date with TTL changes (#26)
  • cf30c8d feat(store): add Head TTL to retain latest N frames per topic (#24)
  • cbf70a8 fix: topic index encoding (#25)
  • 02938f6 feat: support unregister for handlers
  • d1106ae fix: avoid sending any events generated as a response to a handler, back to that handler
  • 71b3c83 fix: 's/eval_block/eval_block_with_early_return/g'
  • f7d367b feat: flesh out support for TTL::Time(Duration)
  • 5d1f2d0 feat: bump fjall dependency from 1.5 to 2.4 πŸŽ‰
  • 9af2792 fix: .pipe now uses eval_block_with_early_return
  • 82edbf3 fix: iterate on error handling / messages when using the cli to call the API
  • 674181d image: add deno2
  • aa02716 example(discord-bot): add README note for slash command handler
  • ed4a5ee example(discord-bot): add an example /dice slash command handler
  • 48776da example(discord-bot): bump API version to v10
  • 4e9b2c7 Update README.md
  • dd00b68 Update README.md
  • ff3a931 example(discord-bot): read access token from the stream
  • ceace87 chore: iterate on the packaged container image
  • 6d2d558 chore: iterate on the packaged container image
  • 6b74142 feat: client support for stores behind https and basicauth (#22)
  • 76e37d1 release: allow --expose to be enabled in the container image
  • 84921cf release: allow --expose to be enabled in the container image
  • f170252 fix(example/solid-ui): actually push up store/cas.ts