Skip to content

Instantly share code, notes, and snippets.

@yhs0602
Created April 19, 2024 09:26
Show Gist options
  • Save yhs0602/09b2f92856d6e8ebed4e7c7f27ce606d to your computer and use it in GitHub Desktop.
Save yhs0602/09b2f92856d6e8ebed4e7c7f27ce606d to your computer and use it in GitHub Desktop.
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