[Discussion] Notion To MD v4: Block Fetcher Technical Details #114
souvikinator
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Block Fetcher Technical Documentation
Overview
graph TD A[Initialize BlockFetcher] --> B[Configure Settings] B --> C[Task Queue Management] C --> D[Rate Limited Fetching] D --> E[Block Organization] E --> F[Return Structured Data]The BlockFetcher module serves as a specialized fetching layer that manages the complexity of retrieving nested Notion content while optimizing performance and respecting API constraints.
Core Capabilities
Instead of handling different types of requests separately, the system now implements a unified task queue that processes:
The system processes these tasks concurrently within configured batch sizes, maintaining optimal performance while respecting API limits.
Rate Limiting Management
The component implements a decent rate limiting system that:
State Management
The system maintains several optimized data structures:
Block Tree Builder
The component now handles block organization more efficiently:
Configuration Options
The BlockFetcher accepts these configuration parameters:
Detailed Implementation Flow
flowchart TD Init[Initialize BlockFetcher] --> Config[Load Configuration] Config --> Queue[Initialize Task Queue] Queue --> InitTasks[Add Initial Tasks] subgraph QueueProcessing[Task Processing Loop] InitTasks --> Empty{Queue Empty?} Empty -->|No| Batch[Take Task Batch] Batch --> RateLimit[Apply Rate Limiting] RateLimit --> Process[Process Tasks in Parallel] Process --> TaskType{Task Type} TaskType -->|Blocks| FetchBlocks[Fetch Block Children] TaskType -->|Comments| FetchComments[Fetch Comments] TaskType -->|Properties| FetchProps[Fetch Properties] FetchBlocks --> Store[Store Results] FetchComments --> Store FetchProps --> Store Store --> QueueMore{Queue Additional Tasks?} QueueMore -->|Yes| AddTasks[Add New Tasks] QueueMore -->|No| Empty AddTasks --> Empty end Empty -->|Yes| BuildTree[Build Block Tree] BuildTree --> Output[Return Data Structure]Interface
Beta Was this translation helpful? Give feedback.
All reactions