Metadata-Version: 2.4
Name: toomanythreads
Version: 0.2.61
Summary: A singleton-based thread management system
Author: Miles Copeland Luce
License: MIT
Keywords: threading,thread,management,singleton,decorator,async
Requires-Python: <4.0,>=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: loguru<0.8.0,>=0.7.3
Requires-Dist: singleton-decorator>=1.0.0
Requires-Dist: uvicorn<0.36.0,>=0.35.0
Requires-Dist: fastapi<0.117.0,>=0.116.1
Requires-Dist: toomanyports<0.2.0,>=0.1.1
Requires-Dist: starlette<0.48.0,>=0.47.2
Dynamic: license-file

# Managed Threads

A singleton-based thread management system with auto-registration, verbose logging, and dynamic mixin support.

## Quick Start

```python
from toomanythreads import ManagedThread, manager
import time

# Simple function to run in a thread
def worker_function(name, delay=1):
    for i in range(5):
        print(f"Worker {name}: iteration {i}")
        time.sleep(delay)

# Create and start a managed thread
thread = ManagedThread(worker_function)
thread.start()

# Check registered threads
print(f"Active threads: {len(manager.threads)}")

# Wait for completion
thread.join()
```

### ManagedThread

A decorator/factory function that creates managed threads. Can be used as a decorator.

**Parameters:**
- `obj`: Callable to run in the thread
- `*args`: Arguments to pass to the callable
- `**kwargs`: Keyword arguments to pass to the callable

**Returns:** Thread instance with management capabilities

## Requirements

- Python 3.8+
- loguru >= 0.6.0
- singleton-decorator >= 1.0.0

## License

MIT License - see LICENSE file for details.
