Created
March 4, 2026 12:01
-
-
Save jacobsapps/a905beaeed31514bf3c8c1bb23afee97 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func postTweet( | |
| text: String, | |
| strategy _: RetryStrategy, | |
| retryOptions _: RetryOptions | |
| ) async throws { | |
| await engine.enqueue(text: text) | |
| } | |
| func enqueue(text: String) async { | |
| let context = ModelContext(container) | |
| let job = PersistedUploadJob(text: text, state: .pending) | |
| context.insert(job) | |
| do { | |
| try context.save() | |
| } catch { | |
| print("Failed to persist job: \(error.localizedDescription)") | |
| } | |
| await processQueueIfNeeded() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment