Skip to content

Add docstring example for dynamic_batching decorator#6235

Open
veeceey wants to merge 1 commit intojina-ai:masterfrom
veeceey:fix/add-dynamic-batching-example
Open

Add docstring example for dynamic_batching decorator#6235
veeceey wants to merge 1 commit intojina-ai:masterfrom
veeceey:fix/add-dynamic-batching-example

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 8, 2026

Summary

  • Adds comprehensive docstring example for @dynamic_batching decorator
  • Previously had TODO(johannes) to add example
  • Demonstrates proper usage with Executor and requests decorator

Changes

  • Added example showing:
    • Using @dynamic_batching with @requests decorator
    • Setting preferred_batch_size and timeout parameters
    • Processing batched DocumentArray in async method
  • Removed TODO comment as example is now complete

Test plan

  • Example follows existing patterns from integration tests
  • Documentation is clear and follows Jina docstring conventions
  • No code changes, only documentation enhancement

Previously, the dynamic_batching decorator docstring had a TODO to add
an example. This commit adds a comprehensive example demonstrating how
to use the decorator with an Executor to enable batching of incoming
requests.

The example shows:
- Using @dynamic_batching with @requests decorator
- Setting preferred_batch_size and timeout parameters
- Processing batched DocumentArray in an async method
@veeceey
Copy link
Author

veeceey commented Feb 19, 2026

Friendly ping - any chance someone could take a look at this when they get a chance? Happy to make any changes if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant