Skip to content

Document buffer(policy:) and mapError(_:), fix docs catalog gaps - #447

Open
maxches99 wants to merge 1 commit into
apple:mainfrom
maxches99:docs/buffer-maperror-guides
Open

Document buffer(policy:) and mapError(_:), fix docs catalog gaps#447
maxches99 wants to merge 1 commit into
apple:mainfrom
maxches99:docs/buffer-maperror-guides

Conversation

@maxches99

Copy link
Copy Markdown

Motivation

The algorithm catalog in README.md and the topic list in AsyncAlgorithms.md have drifted from the set of algorithms the package actually vends, so several public algorithms are not reachable from either the README or the rendered DocC documentation.

Concretely, on main:

  • buffer(policy:) has no guide, no README entry and no topic entry.
  • mapError(_:) has no guide and no README entry.
  • FlatMapLatest has a guide, but it is missing from the topic list, so it is not rendered.
  • Chunked.md links to AsyncChunksOfCountAndSignalSequence.swift, which 404s — the type is AsyncChunksOfCountOrSignalSequence — and lists AsyncChunkedOnProjectionSequence.swift twice.

Fixes #300.
Addresses the documentation gap tracked in #408 (the share README entry itself is covered by #443 — see the note below).

The Chunked.md link is the same class of breakage as #284, which was fixed for Intersperse.md but missed here.

Modifications

  • Add Guides/Buffer.md documenting buffer(policy:) and the four AsyncBufferSequencePolicy cases.
  • Add Guides/MapError.md documenting the two mapError(_:) overloads.
  • Add <doc:Buffer>, <doc:MapError> and the missing <doc:FlatMapLatest> to the topic list in AsyncAlgorithms.md.
  • Add buffer(policy:) and mapError(_:) to the README catalog.
  • Fix the Chunked.md source links.

The buffering behaviour described in Buffer.md was checked against the state machines rather than transcribed from the doc comments: bufferingLatest(_:) drops the oldest buffered element, bufferingOldest(_:) drops the incoming element, and a limit of 0 bypasses buffering entirely (AsyncBufferSequence.makeAsyncIterator() selects the transparent storage). Note that the doc comment on buffer(policy:) refers to the policy as bufferingNewest, which is the internal case name; the guide uses the public spelling bufferingLatest.

Effects.md already lists AsyncBufferSequence, and AsyncMapErrorSequence is internal, so that table is unchanged.

Result

Every guide in the catalog is reachable from the topic list, every <doc:> reference resolves to a file in Guides/, every source and test link in every guide points at a file that exists, and buffer(policy:) and mapError(_:) are discoverable from the README.

Note on #443

#443 is approved and touches the same README section within a couple of lines of these two additions, so this will likely need a trivial conflict resolution. Happy to rebase once #443 lands — just let me know if you would rather have it that way round.

The README algorithm catalog and the DocC topic list did not cover every
public algorithm:

* `buffer(policy:)` had no guide, no README entry and no topic entry.
* `mapError(_:)` had no guide and no README entry.
* `FlatMapLatest` had a guide but was missing from the topic list, so it
  did not appear in the rendered documentation.
* `Chunked.md` linked to `AsyncChunksOfCountAndSignalSequence.swift`,
  which does not exist - the type is `AsyncChunksOfCountOrSignalSequence` -
  and listed `AsyncChunkedOnProjectionSequence.swift` twice.

Add the two missing guides, list them along with FlatMapLatest in the
topic list, add the two missing README entries and correct the Chunked
source links.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

README and Guides are missing docs for buffer(policy:)

1 participant