Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find Future implementation in scala.concurrent?

I am trying to understand what exactly happens, when I call

val f = scala.concurrent.Future {... // my body function }

The code of object Future defines apply methods as follows:

def apply[T](body: =>T)(implicit execctx: ExecutionContext): Future[T] =
   impl.Future(body)

Unfortunately I do not see where the impl is defined in the code (and what it exactly does). My question is where the impl is defined.

like image 474
Michael Avatar asked May 14 '13 12:05

Michael


1 Answers

impl is just a package from which Future object borrows implementation class.

enter image description here

Since Future object lives in the same concurrent package it could address impl package effortlessly (no explicit imports required)

like image 89
om-nom-nom Avatar answered Sep 30 '22 17:09

om-nom-nom