Completed clean root directory structure: - Root now contains only: .git, .env, docs/, orig/ - Moved all remaining files and directories to orig/: - Config files (.claude, .dockerignore, .drone.yml, etc.) - All .env variants (except active .env) - Git config (.gitconfig, .github, .gitignore, etc.) - Tool configs (.golangci.yml, .revive.toml, etc.) - Documentation (*.md files, @prompts) - Build files (Dockerfiles, Makefile, go.mod, go.sum) - Docker compose files - All source directories (scripts, tests, tools, etc.) - Runtime directories (logs, monitoring, reports) - Dependency files (node_modules, lib, cache) - Special files (--delete) - Removed empty runtime directories (bin/, data/) V2 structure is now clean: - docs/planning/ - V2 planning documents - orig/ - Complete V1 codebase preserved - .env - Active environment config (not in git) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
27 lines
1.3 KiB
Markdown
27 lines
1.3 KiB
Markdown
You are an expert in Go concurrency patterns and high-performance systems. I'm building an MEV bot that needs to efficiently process thousands of transactions per second using advanced concurrency patterns.
|
|
|
|
I need help with:
|
|
|
|
1. Implementing efficient worker pools for transaction processing
|
|
2. Creating pipeline patterns for multi-stage processing
|
|
3. Implementing fan-in and fan-out patterns for data distribution
|
|
4. Using channels effectively for communication between goroutines
|
|
5. Managing rate limiting across multiple RPC endpoints
|
|
6. Implementing backpressure handling to prevent resource exhaustion
|
|
7. Optimizing memory usage and garbage collection
|
|
8. Using context for cancellation and timeouts
|
|
|
|
Please provide production-ready Go code that:
|
|
- Implements efficient concurrency patterns
|
|
- Handles errors gracefully without leaking goroutines
|
|
- Uses appropriate buffering for channels
|
|
- Follows Go best practices for concurrent programming
|
|
- Includes comprehensive comments explaining the patterns used
|
|
- Provides metrics for monitoring performance
|
|
|
|
The code should:
|
|
- Process transactions with minimal latency
|
|
- Scale efficiently across multiple CPU cores
|
|
- Handle backpressure gracefully
|
|
- Provide clear error handling and recovery
|
|
- Include benchmarks for critical functions |