dyn-provider

Community

Register and manage external types for dependency injection.

Authorjymchng
Version1.0.0
Installs0

System Documentation

What problem does it solve?

DynProvider Skill simplifies the registration and management of external types within the dependency injection framework, allowing for more flexible and dynamic dependencies.

Core Features & Use Cases

  • External Type Registration: Dynamically register external types (sync, async, with-context, from-value) using a token string for each registration.
  • Token-Based Providers: Differentiate between multiple providers of the same type using distinct tokens (e.g., "primary"/"replica" pools).
  • Use Case: In a microservices architecture, use DynProvider to register different database pools for primary and replica services, managing their lifecycles and configurations separately.

Quick Start

Register a sync DynProvider with a default token:

use injectable::prelude::*;

Container::builder()
    .register("", DynProvider::sync(|| {
        Ok(reqwest::Client::new())
    }))
    .build().await?;

Dependency Matrix

Required Modules

injectable

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: dyn-provider
Download link: https://github.com/jymchng/injectable/archive/main.zip#dyn-provider

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 620,000+ vetted skills library on demand.