All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mle.play.actions.Actions.scala Maven / Gradle / Ivy

package com.mle.play.actions

import com.mle.play.concurrent.ExecutionContexts
import play.api.mvc.{SimpleResult, _}

import scala.concurrent.Future

/**
 *
 * @author mle
 */
trait Actions {

  /**
   * Executes the work on a large thread pool suitable for synchronous IO.
   */
  class SyncAction extends DefaultActionBuilder {
    override protected val executionContext = ExecutionContexts.synchronousIO
  }

  object SyncAction extends SyncAction

  /**
   * Default action builder, override what you need.
   */
  abstract class DefaultActionBuilder extends ActionBuilder[Request] {
    def invokeBlock[A](request: Request[A], block: (Request[A]) => Future[SimpleResult]): Future[SimpleResult] =
      block(request)
  }

}

object Actions extends Actions




© 2015 - 2025 Weber Informatics LLC | Privacy Policy