Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OR-5283 Schedulers:: Scheduler implementations:: ImmediateScheduler #138

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

crazymanish
Copy link
Owner

@crazymanish crazymanish commented Aug 17, 2023

Context

Scheduler

  • https://developer.apple.com/documentation/combine/scheduler/
  • A scheduler is a protocol that defines when and how to execute a closure.
  • You can use a scheduler to execute code as soon as possible, or after a future date.
  • Schedulers can accept options to control how they execute the actions passed to them. These options may control factors like which threads or dispatch queues execute the actions.

In this PR

  • Schedulers:: Scheduler implementations:: ImmediateScheduler
  • Apple provides several concrete implementations of the Scheduler protocol:

  • ImmediateScheduler: A simple scheduler that executes code immediately on the current thread, which is the default execution context unless modified using subscribe(on:), receive(on:) or any of the other operators which take a scheduler as parameter.
  • You can only use this scheduler for immediate actions. If you attempt to schedule actions after a specific date, this scheduler ignores the date and performs them immediately.
  • https://developer.apple.com/documentation/combine/immediatescheduler

  • RunLoop: Tied to Foundation’s Thread object.
  • DispatchQueue: Can either be serial or concurrent. most versatile and useful scheduler
  • OperationQueue: A queue that regulates the execution of work items.

@crazymanish crazymanish linked an issue Aug 17, 2023 that may be closed by this pull request
@crazymanish crazymanish merged commit a2d2b4b into main Aug 17, 2023
@crazymanish crazymanish deleted the OR-5284-p1 branch August 17, 2023 16:16
@crazymanish crazymanish mentioned this pull request Aug 17, 2023
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.

[w32(6august-12august)] Schedulers: Practices/exercises
1 participant