Commit Graph
12 Commits
Author SHA1 Message Date
TechnoPorg 827041c1b6 chore: clean up in preparation for release 2026-02-18 22:34:31 +01:00
TechnoPorg 72a83e29dc test: update tests/examples/benches 2026-02-17 21:31:18 +01:00
TechnoPorg e4fc0b0d44 refactor: make DagRunner interface single-threaded 2026-02-17 21:29:14 +01:00
TechnoPorg b8204c4ed9 refactor: consolidate some tests/examples/benchmarks 2026-02-12 23:31:19 +01:00
TechnoPorg 4ef7e69cdd Don't clone task inputs 2026-02-11 22:29:54 +01:00
TechnoPorg 0137296fb4 Remove clone bound from task data 2026-02-11 21:59:41 +01:00
TechnoPorg 1c9034de71 Don't require an explicit return type in the task macro 2026-01-28 08:52:52 +01:00
TechnoPorg f4160d2387 Update docs 2026-01-22 00:30:48 +01:00
TechnoPorg df39dd80b9 Don't use channels to send dependencies 2026-01-19 00:24:32 +01:00
swaits 979232bd67 docs: document custom type support throughout project
Update all documentation to reflect that custom types work automatically
with the #[task] macro, requiring only Clone + Send + Sync + 'static.

Documentation updates:
- README: Add custom types to features, new Custom Types section
- CHANGELOG: Document custom type improvement in [Unreleased]
- src/lib.rs: Add custom types example to main API docs
- src/task.rs: Update Task trait docs to mention macro-generated extraction
- src/extract.rs: Clarify ExtractInput is now internal-only (for task_fn)
- dagx-macros: Update macro docs to emphasize automatic type handling

New example:
- examples/custom_types.rs: Simple 120-line example showing User type
  flowing through DAG with fan-out pattern (one output → two consumers)
  demonstrating Arc wrapping is automatic and transparent

This makes the custom type capability discoverable and prominent for users,
turning a previous limitation into a headline feature.
2025-10-10 17:22:59 -06:00
swaits fad97dbf16 fix: support arbitrary types in task dependencies
Enable tasks to accept ANY type implementing Clone + Send + Sync as
dependencies, without requiring users to implement ExtractInput trait.

The #[task] macro now generates task-specific extraction logic inline
via a new extract_and_run() method. This leverages the macro's perfect
compile-time knowledge of parameter types to handle extraction for:
- Zero parameters (unit type, source tasks)
- Single parameter (any Clone + Send + Sync type)
- Multiple parameters (tuples, awaited concurrently)

Previously, only hardcoded primitive types and specific stdlib types
worked. Custom user types required manual ExtractInput implementations.
Now custom types work automatically with zero API changes.

Changes:
- Add extract_and_run() method to Task trait (internal/hidden)
- Generate inline extraction in #[task] macro based on parameter count
- Remove ExtractInput bound from DagRunner::add_task()
- Retain ExtractInput for internal task_fn() test helper
- Add comprehensive custom type tests

No breaking changes - purely internal implementation improvement.
2025-10-10 17:06:38 -06:00
swaits 7412287ee4 feat: dagrunner, initial version 2025-10-07 16:31:03 -07:00