aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scala/async/BlockingAsync.scala
blob: 3deeb37c591ec2cad4451356331b3bff0723adcf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * Copyright (C) 2012 Typesafe Inc. <http://www.typesafe.com>
 */

package scala.async

import scala.language.experimental.macros
import scala.reflect.macros.Context
import scala.reflect.internal.annotations.compileTimeOnly

object BlockingAsync extends AsyncBase {

  import scala.concurrent.Future

  lazy val futureSystem = BlockingFutureSystem
  type FS = BlockingFutureSystem.type

  def async[T](body: T) = macro asyncImpl[T]

  override def asyncImpl[T: c.WeakTypeTag](c: Context)(body: c.Expr[T]): c.Expr[Future[T]] = super.asyncImpl[T](c)(body)
}