Documentation
¶
Overview ¶
Package manager provides concurrent job submission, polling, and result retrieval across multiple quantum backends.
A Manager holds registered backends and offers Manager.Submit for synchronous execution, Manager.SubmitAsync for single-backend async, Manager.SubmitBatch for multi-backend fan-out, and Manager.Watch for streaming status updates.
Concurrency is bounded by WithMaxConcurrent. Observability hooks from the context are invoked automatically around job lifecycle events.
Package manager provides concurrent job submission and polling.
Index ¶
- type Manager
- func (m *Manager) Register(name string, b backend.Backend)
- func (m *Manager) Submit(ctx context.Context, name string, req *backend.SubmitRequest) (*backend.Result, error)
- func (m *Manager) SubmitAsync(ctx context.Context, name string, req *backend.SubmitRequest) <-chan ResultOrError
- func (m *Manager) SubmitBatch(ctx context.Context, backends []string, req *backend.SubmitRequest) <-chan ResultOrError
- func (m *Manager) SubmitSweep(ctx context.Context, name string, c *ir.Circuit, shots int, sw sweep.Sweep) <-chan SweepResultOrError
- func (m *Manager) Watch(ctx context.Context, name string, jobID string) <-chan *backend.JobStatus
- type Option
- type ResultOrError
- type SweepResultOrError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles concurrent job submission, polling, and result retrieval.
func (*Manager) Submit ¶
func (m *Manager) Submit(ctx context.Context, name string, req *backend.SubmitRequest) (*backend.Result, error)
Submit sends a job to a backend, polls until completion, and returns the result.
func (*Manager) SubmitAsync ¶
func (m *Manager) SubmitAsync(ctx context.Context, name string, req *backend.SubmitRequest) <-chan ResultOrError
SubmitAsync sends a job and returns a channel that delivers the result.
func (*Manager) SubmitBatch ¶
func (m *Manager) SubmitBatch(ctx context.Context, backends []string, req *backend.SubmitRequest) <-chan ResultOrError
SubmitBatch sends the same request to multiple backends concurrently. Results are delivered on the returned channel as they complete.
func (*Manager) SubmitSweep ¶
func (m *Manager) SubmitSweep(ctx context.Context, name string, c *ir.Circuit, shots int, sw sweep.Sweep) <-chan SweepResultOrError
SubmitSweep resolves the sweep, binds each parameter point to the circuit, and submits each bound circuit to the named backend. Results are delivered on the returned channel as they complete.
type Option ¶
type Option func(*Manager)
Option configures a Manager.
func WithLogger ¶
WithLogger sets the structured logger for the manager.
func WithMaxConcurrent ¶
WithMaxConcurrent sets the maximum number of concurrent job submissions.
func WithPollFrequency ¶
WithPollFrequency sets how often the manager polls for job status.
type ResultOrError ¶
ResultOrError wraps a result or an error from an async submission.