Skip to content

Document thread semantics - #261

Merged
farmdawgnation merged 1 commit into
mainfrom
farmdawgnation/investigate-different-thread-allocation-semantic
Nov 12, 2026
Merged

farmdawgnation merged 1 commit into
mainfrom
farmdawgnation/investigate-different-thread-allocation-semantic

Conversation

@farmdawgnation

Copy link
Copy Markdown
Member

No description provided.

- Add Scaladoc to Http.withConfiguration noting that each executor
  owns its own AHC client, pool, and threads, so it should be created
  once, reused, and shut down.
- Replace docs/05/00 with a guide to Http executors: the default
  executor, custom configuration, thread cost, shutdown, and
  closeAndConfigure.
- Add docs/05/a on capping I/O threads, sharing an event loop group
  and timer across executors, and naming threads.
- Move the Scaladoc index to docs/06/00 so it follows the new pages.
Copilot AI balanced review requested due to automatic review settings November 12, 2026 03:23
@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issue was established.

Summary

This PR documents how to create, reuse, configure, and shut down Http executors.

  • HTTP executor guides explain how to configure and close clients.
  • The thread guide shows how executors limit and share their threads.
  • The Scaladoc index now has its own page after the executor guide.

No actionable issues were established.

Reviews (1) · Last reviewed commit: "Document Http executor lifecycle and thr..." · Reviewed by Greptile

@farmdawgnation farmdawgnation changed the title farmdawgnation/investigate-different-thread-allocation-semantic Document thread semantics Nov 12, 2026
@farmdawgnation
farmdawgnation merged commit af18b4c into main Nov 12, 2026
13 checks passed
@farmdawgnation
farmdawgnation deleted the farmdawgnation/investigate-different-thread-allocation-semantic branch November 12, 2026 03:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The example uses Netty APIs unavailable in the documented dependency set and therefore fails to compile, while the client initialization and thread-ownership descriptions also need correction.

2 open issues
What changed in this PR

This documentation-focused PR explains how Dispatch HTTP executors allocate and manage resources, helping users reuse clients and control thread usage.

Changes:

  • Document executor configuration, resource costs, reuse, and shutdown.
  • Add examples for limiting, sharing, and naming threads.
  • Expand withConfiguration Scaladoc and relocate the Scaladoc index.
File Description
docs/​06/​00.markdown Relocates the existing Scaladoc index without changing its links.
docs/​05/​a.markdown Adds thread configuration and shared-resource lifecycle examples.
docs/​05/​00.markdown Replaces the index with executor configuration and lifecycle guidance.
core/​src/​main/​scala/​execution.scala Adds resource-management guidance to Scaladoc; runtime behavior is unchanged.

Review effort: Balanced

Comment on lines +65 to +67
* Each executor this returns gets its own AHC client, connection pool, and threads once it
* makes its first request. Create it once and reuse it, and call `shutdown()` when you're done
* with it.
Comment thread docs/05/a.markdown
Comment on lines +25 to +29
import io.netty.channel.MultiThreadIoEventLoopGroup
import io.netty.channel.nio.NioIoHandler
import io.netty.util.HashedWheelTimer

val ioThreads = new MultiThreadIoEventLoopGroup(4, NioIoHandler.newFactory())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants