Skip to content

Commit

Permalink
update diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat committed Feb 18, 2024
1 parent 259854c commit 989ca11
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br />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.<br />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
```

0 comments on commit 989ca11

Please sign in to comment.