Created
April 19, 2024 09:26
-
-
Save yhs0602/09b2f92856d6e8ebed4e7c7f27ce606d to your computer and use it in GitHub Desktop.
This file contains 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
def foo(implicit n: 42) = { n + 1 } | |
implicit n = 55; | |
foo // 56 | |
trait ConcurrentRunner { def run() } | |
class NilRunner < ConncurrentRunner; | |
class ThreadPoolRunner < ConncurrentRunner; | |
class RealConcurrentRunner < ConncurrentRunner; | |
def foo(implicit runner) { runner.run { future { // heavry job... }} | |
implicit runner = NIlRUnner | |
Future { 42 }.map { _ + 1 }.filter { _ > 0 } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment