diff --git a/README.md b/README.md index 1a77188..848ad63 100644 --- a/README.md +++ b/README.md @@ -100,31 +100,32 @@ sequenceDiagram autonumber actor User participant httprc.Cache - participant httprc.Storage + participant httprc.registry + participant httprc.HTTPClient User->>httprc.Cache: Fetch URL `u` - activate httprc.Storage - httprc.Cache->>httprc.Storage: Fetch local cache for `u` + activate httprc.registry + httprc.Cache->>httprc.registry: Fetch local cache for `u` alt Cache exists - httprc.Storage-->httprc.Cache: Return local cache + httprc.registry-->httprc.Cache: Return local cache httprc.Cache-->>User: Return data - Note over httprc.Storage: If the cache exists, there's nothing more to do.
The cached content will be updated periodically in httprc.Refresher - deactivate httprc.Storage + Note over httprc.registry: If the cache exists, there's nothing more to do.
The cached content will be updated periodically in httprc.queue + deactivate httprc.registry else Cache does not exist - activate httprc.Fetcher - httprc.Cache->>httprc.Fetcher: Fetch remote resource `u` - httprc.Fetcher-->>httprc.Cache: Return fetched data - deactivate httprc.Fetcher + activate httprc.HTTPClient + httprc.Cache->>httprc.HTTPClient: Fetch remote resource `u` + httprc.HTTPClient-->>httprc.Cache: Return fetched data + deactivate httprc.HTTPClient httprc.Cache-->>User: Return data - httprc.Cache-)httprc.Refresher: Enqueue into auto-refresh queue - activate httprc.Refresher - loop Refresh Loop - Note over httprc.Storage,httprc.Fetcher: Cached contents are updated synchronously - httprc.Refresher->>httprc.Refresher: Wait until next refresh - httprc.Refresher-->>httprc.Fetcher: Request fetch - httprc.Fetcher->>httprc.Refresher: Return fetched data - httprc.Refresher-->>httprc.Storage: Store new version in cache - httprc.Refresher->>httprc.Refresher: Enqueue into auto-refresh queue (again) + httprc.Cache-)httprc.queue: Enqueue into auto-refresh queue + activate httprc.queue + loop queue Loop + Note over httprc.registry,httprc.Fetcher: Cached contents are updated synchronously + httprc.queue->>httprc.queue: Wait until next refresh + httprc.queue-->>httprc.Fetcher: Request fetch + httprc.HTTPClient->>httprc.queue: Return fetched data + httprc.queue-->>httprc.registry: Store new version in cache + httprc.queue->>httprc.queue: Enqueue into auto-refresh queue (again) end - deactivate httprc.Refresher + deactivate httprc.queue end ```