Documentation ¶
Overview ¶
Package postalpool provides a service for managing multiple libpostal process instances and a client for distributing requests across them in a round-robin fashion.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides thread-safe access to a pool of libpostal processes, distributing requests across them in a round-robin fashion. Each request is automatically routed to the next available worker process.
Requests will be queued up on workers and start to block if every worker has an active request. libpostal is single threaded.
Client maintains an address pool to the worker processes. It provides a simple API that hides the complexity of working with multiple postal processes.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service spawns a pool of libpostal process instances. It handles running and graceful shutdown of worker processes. Each worker process has its own isolated copy of libpostal's global state, allowing for concurrent processing without contention.
A Service should be created via NewService() and stopped using the Shutdown() method when no longer needed. The Service ensures all worker processes are properly terminated on shutdown.