nakago

A lightweight async dependency injection toolkit for Rust

MIT License

Downloads
45K
Stars
42
Committers
1

Bot releases are hidden (Show)

nakago - v0.7.1

Published by bkonkle about 1 year ago

0.7.1 - 2023-08-13

Changed

  • crossterm updated to v0.27
  • sea-orm updated to v0.12
nakago - v0.7.0

Published by bkonkle about 1 year ago

0.7.0 - 2023-08-13

This is a significant checkpoint, achieving fully async-driven operation with lazy Providers that are only executed when their provided Dependency is requested. To facilitate this, each Dependency is now wrapped in an Arc and no mutable references are no longer possible.

Expect major changes to the Application and Lifecycle systems going forward, building on these changes.

Added

  • Added a new inject::Injector type that encapsulates a new strategy for on-demand Provider execution in an async context.

Changed

  • Changes across nakago and nakago-axum, reflected in the examples/async-graphql example app. Providers are no longer eagerly executed, they are instead held within the injection container and are the primary way for dependencies to be provided now. When a dependency is requested, the Provider is then invoked and a Shared Future is created in order to share the results with any thread awaiting that dependency.

Removed

  • Removed the ability to get a mutable reference, since everything is async-by-default now and Arcs are used everywhere to allow references to traverse threads.
nakago - v0.6.0

Published by bkonkle about 1 year ago

0.6.0 - 2023-05-08

Added

  • Added Init, Startup, and Shutdown lifecycle events, which Hooks can now be attached to in the renamed top-level Application struct (see below).
  • Added Route specifiers to nakago-axum based on Axum routes, which are attached to the top-level Router via nesting.

Changed

  • Renamed nakago::system::System to nakago::app::Application
  • Moved to a registry system of Hooks attached to lifecycle Events.
  • Moved away from FnvHashMap because the keys are possibly textual rather than simple integers.
  • Renamed HttpApplication to AxumApplication to better reflect the specific library used behind the scenes.
  • Revised the Async-GraphQL example to use the new lifecycle events.

Removed

  • Removed most of the constructors for Application and AxumApplication (formerly System and HttpApplication) because they aren't needed now.
nakago - v0.5.0

Published by bkonkle over 1 year ago

0.5.0 - 2023-02-27

Added

  • Added the nakago-axum crate for HTTP routes (#9)
  • Added Config loading based on Figment (#9)
  • Added Hooks to the inject module, which are like Providers but can mutate the Inject container (#9)
  • Added a top-level Application with Init (pre-config) and Startup (pre-run) hooks (#9)
  • Added an Axum HTTP Application with a run() method that starts the server (#9)
  • Added a test Async-GraphQL example (#9)

Changed

  • Prioritized Tag-driven mode for Inject. Renamed the TypeId-driven fields to have a _type prefix, and removed the _tag prefix from the Tag-driven fields. (#9)
nakago - v0.4.0

Published by bkonkle over 1 year ago

0.4.0 - 2023-02-15

Changed

  • Moved the "tag" parameter on all tag-based operations to the front of the method signature, for easier readability. (#8)
nakago - v0.3.0

Published by bkonkle over 1 year ago

0.3.0 - 2023-02-15

Changed

  • Export more things for easier ergonomics (#5)

Fixed

  • Fixed the CI build (#4)
  • Disabled auto-publishing (for now) (#4)

Removed

  • Remove inject::ProvideResult and inject::provide(...) and clean up unnecessary boxing. (#6)
nakago - v0.2.0

Published by bkonkle over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/bkonkle/nakago/compare/0.1.0...0.2.0

nakago - v0.1.0

Published by bkonkle over 1 year ago

The initial release!

What's Changed

  • Added an Injection Container
  • Added Injection Tags
  • Added Injection Providers
  • Added documentation

Full Changelog: https://github.com/bkonkle/nakago/commits/0.1.0

Package Rankings
Top 41.46% on Crates.io
Badges
Extracted from project README
Crates.io Docs.rs CI Coverage Status Rust Tokio Axum
Related Projects