Skip to content

Conversation

@smoores-dev
Copy link
Contributor

@smoores-dev smoores-dev commented Nov 16, 2025

Follow up to the discussion here.

Allows onCreatePublication to be async, so that consumers can utilize async methods (e.g. reading a resource's contents) in the callback.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables asynchronous operations within onCreatePublication callbacks by converting the Publication.Builder.Transform typealias and related methods to async. This allows consumers to use async methods (e.g., reading resource contents) when modifying publication components during construction.

Key changes:

  • Made Publication.Builder.Transform typealias async
  • Updated Publication.Builder.apply() method to be async and await the transform
  • Updated PublicationOpener to await when applying transforms

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
Sources/Shared/Publication/Publication.swift Modified Transform typealias and apply() method to support async callbacks
Sources/Streamer/PublicationOpener.swift Updated transform application to use await with the now-async apply() method
CHANGELOG.md Documented the async callback support feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thank you @smoores-dev!

@mickael-menu mickael-menu merged commit 35b5072 into readium:develop Nov 24, 2025
11 checks passed
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.

2 participants