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

Add Task.shift, add forceAsync param to #executeOn #422

Merged
merged 4 commits into from Sep 5, 2017

Conversation

Projects
None yet
1 participant
@alexandru
Member

alexandru commented Sep 5, 2017

Adding Task.shift as the equivalent of IO.shift, but with a Monix twist, given that we have a "default" scheduler being passed in runAsync:

object Task {

  final val shift: Task[Unit] = ???

  def shift(ec: ExecutionContext): Task[Unit] = ???
}

Also executeOn had to be updated with an extra optional parameter:

class Task[+A] {
  //...

  def executeOn(s: Scheduler, forceAsync: Boolean = true): Task[A] = ???
}

We now have a forcedAsync that dictates whether an async boundary should be forced before evaluation or not. By default it is set to true, but if false is given, then the executeOn call only overrides the default scheduler, but with no asynchronous boundary.

Also did the equivalent for Observable:

trait Observable[+A] {
  //...

  def executeOn(s: Scheduler, forceAsync: Boolean = true): Observable[A] = ???
}
@codecov

This comment has been minimized.

codecov bot commented Sep 5, 2017

Codecov Report

Merging #422 into master will increase coverage by 0.03%.
The diff coverage is 94.11%.

@@            Coverage Diff             @@
##           master     #422      +/-   ##
==========================================
+ Coverage   88.67%   88.71%   +0.03%     
==========================================
  Files         340      341       +1     
  Lines        9386     9407      +21     
  Branches     1274     1280       +6     
==========================================
+ Hits         8323     8345      +22     
+ Misses       1063     1062       -1

@alexandru alexandru changed the title from WIP: Add Task.shift, add forceAsync param to Task.executeOn to Add Task.shift, add forceAsync param to Task.executeOn Sep 5, 2017

@alexandru alexandru changed the title from Add Task.shift, add forceAsync param to Task.executeOn to Add Task.shift, add forceAsync param to #executeOn Sep 5, 2017

alexandru added some commits Sep 5, 2017

@alexandru alexandru merged commit e6f097d into monix:master Sep 5, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@alexandru alexandru added this to the 3.0.0 milestone Jan 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment