The dispatcher runs outside any HTTP request and executes tasks concurrently, so it must never
share one provider — and therefore one transaction scope — across parallel work. Rather than
import MJServer (which would invert the dependency: MJServer depends on this package, not the
reverse), the host supplies a factory. MJServer's implementation wraps the same
createPerRequestProviders machinery that already mints a provider per request over the shared
connection pool, which is proven cheap at request scale.
Contract: every call returns a provider safe to use on its own transaction scope. Callers are
responsible for nothing beyond using it — pooling and lifetime are the host's concern.
Mints a fresh metadata/data provider.
The dispatcher runs outside any HTTP request and executes tasks concurrently, so it must never share one provider — and therefore one transaction scope — across parallel work. Rather than import MJServer (which would invert the dependency: MJServer depends on this package, not the reverse), the host supplies a factory. MJServer's implementation wraps the same
createPerRequestProvidersmachinery that already mints a provider per request over the shared connection pool, which is proven cheap at request scale.Contract: every call returns a provider safe to use on its own transaction scope. Callers are responsible for nothing beyond using it — pooling and lifetime are the host's concern.