# Story 6.1: Remove Unused Concurrency Primitives

## Status: Complete

## Summary

Delete the three unused concurrency classes from `core/concurrency.py`: `AsyncBoundedExecutor`, `LockFreeRingBuffer`, and `AsyncWorkStealingExecutor`. These were built for potential future optimization but are not used by the logging pipeline.

## Motivation

The complexity audit identified 415 lines of sophisticated concurrency code that provides zero value:

- `AsyncBoundedExecutor` (139 lines) — Not imported anywhere
- `LockFreeRingBuffer` (109 lines) — Not imported anywhere
- `AsyncWorkStealingExecutor` (188 lines) — Not imported anywhere

The only class actually used is `NonBlockingRingQueue` (imported in `logger.py` and `worker.py`).

The presence of unused code:

- Confuses developers trying to understand the codebase
- Increases cognitive load during code review
- May suggest premature optimization patterns to contributors

## Acceptance Criteria

- [ ] `AsyncBoundedExecutor` class removed from `concurrency.py`
- [ ] `LockFreeRingBuffer` class removed from `concurrency.py`
- [ ] `AsyncWorkStealingExecutor` class removed from `concurrency.py`
- [ ] `_VULTURE_USED` marker at bottom of file removed (no longer needed)
- [ ] `BackpressurePolicy` enum retained (used by remaining code)
- [ ] `BackpressureError` import retained (used by remaining code)
- [ ] All existing tests pass
- [ ] No grep hits for removed class names in `src/` or `tests/`

## Technical Approach

1. Verify no imports exist:

   ```bash
   grep -r "AsyncBoundedExecutor\|LockFreeRingBuffer\|AsyncWorkStealingExecutor" src/ tests/
   ```

2. Remove class definitions from `concurrency.py`

3. Remove associated test files if any exist in `tests/unit/`

4. Remove `_VULTURE_USED` tuple at end of file

5. Update any docstrings that reference removed classes

## Files Changed

- `src/fapilog/core/concurrency.py` — Remove 3 classes (~415 lines)
- `tests/unit/test_concurrency.py` — Remove tests for deleted classes (if present)

## Estimated Effort

1-2 hours

## Risk Assessment

**Risk Level: Low**

- Classes are confirmed unused via grep
- No external API surface affected
- No behavior change to logging pipeline
- Easy to revert if needed

## Rollback Plan

Revert the commit; classes can be restored from git history.

## Future Consideration

If high-performance executors are needed in future:

- Build based on measured bottlenecks, not speculation
- Consider whether `asyncio.TaskGroup` (Python 3.11+) meets needs
- Profile before implementing custom concurrency primitives
