uk.gov.hmrc.play.asyncmvc.async

# AsyncMVC

###
Related Doc: package async

#### trait AsyncMVC[OUTPUT] extends AsyncTask[OUTPUT] with SessionHandler with AsyncValidation with LogWrapper

The AsyncMVC trait supports two features detailed below...

1) Action wrapper (asyncWrapper) to define the code-block to be processed off-line in a background queue. The client is responsible for polling the framework to understand when the task completes.

2) Async action wrapper (asyncActionWrapper). The wrapper is used to stop the user from jumping to different pages (within a specific web journey) while an async task is being processed for the user. If a task is currently running, the user will be returned to the polling page.

OUTPUT

  - The type of the response from the Future being off-lined.

Self Type
  AsyncMVC[OUTPUT] with Results

Linear Supertypes
AsyncValidation, SessionHandler, AsyncTask[OUTPUT], LogWrapper, AnyRef, Any
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. AsyncMVC
2. AsyncValidation
3. SessionHandler
4. AsyncTask
5. LogWrapper
6. AnyRef
7. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Type Members

1. #### class AsyncActionWrapper extends AnyRef

2. #### class AsyncMVCAsyncActor extends Actor

   Defines an Actor which is responsible for processing the AsyncMVCAsyncActor.AsyncMessage message.

   Defines an Actor which is responsible for processing the AsyncMVCAsyncActor.AsyncMessage message.

   Definition Classes
     AsyncTask

3. #### type callbackSuccessType = (OUTPUT) ⇒ (String) ⇒ Future[Result]

4. #### type callbackWithStatusType = (Int) ⇒ (Option[String]) ⇒ Future[Result]

### Abstract Value Members

1. #### abstract def actorRef: ActorRef

2. #### abstract def asyncPaths(implicit request: Request[AnyContent]): Seq[AsyncPaths]

   Definition Classes
     AsyncValidation

3. #### abstract def blockingDelayTime: Long

4. #### abstract def convertToJSONType(value: String): OUTPUT

5. #### abstract def getClientTimeout: Long

   Definition Classes
     SessionHandler

6. #### abstract def id: String

   Definition Classes
     AsyncValidation

7. #### abstract def outputToString(value: OUTPUT): String

8. #### abstract def taskCache: Cache[TaskCache]

9. #### abstract def throttleLimit: Long

10. #### abstract def waitForAsync: Call

### Concrete Value Members

1. #### final def !=(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

2. #### final def ##(): Int

   Definition Classes
     AnyRef → Any

3. #### final def ==(arg0: Any): Boolean

   Definition Classes
     AnyRef → Any

4. #### object AsyncMVCAsyncActor

   Object encapsulates the message handling and the definition of the Akka message.

   Object encapsulates the message handling and the definition of the Akka message.

   Definition Classes
     AsyncTask

5. #### final val AsyncMVCSessionId: String("ASYNC_MVC_ID")

   Definition Classes
     SessionHandler

6. #### final def asInstanceOf[T0]: T0

   Definition Classes
     Any

7. #### def asyncActionWrapper: (AsyncMVC.this)#AsyncActionWrapper

8. #### def asyncWrapper(callbackWithStatus: (AsyncMVC.this)#callbackWithStatusType)(futureFunction: (HeaderCarrier) ⇒ Future[OUTPUT])(implicit headerCarrier: HeaderCarrier, request: Request[AnyContent]): Future[Result]

   Wrap the Future for off-line processing.

   Wrap the Future for off-line processing.

   callbackWithStatus

     - Invoked when the client is responsible for rendering the display based on a status.

   futureFunction

     - The Future function to invoke off-line.

   returns

     - Future[Result] Important Note: The callbacks defined by the caller could include implicit parameters. This allows contexts (like the AuthContext) to be passed back to the caller transparently from this library!

9. #### def buildSession(id: String, uniqueId: String): String

   Definition Classes
     SessionHandler

10. #### def buildSessionWithMVCSessionId(id: String, uniqueId: String, data: Map[String, String])(implicit request: Request[AnyContent]): Map[String, String]

    Definition Classes
      SessionHandler

11. #### def buildUniqueId(): String

    Definition Classes
      SessionHandler

12. #### def clearASyncIdFromSession(data: Map[String, String]): Map[String, String]

    Definition Classes
      SessionHandler

13. #### def clone(): AnyRef

    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

14. #### final def eq(arg0: AnyRef): Boolean

    Definition Classes
      AnyRef

15. #### def equals(arg0: Any): Boolean

    Definition Classes
      AnyRef → Any

16. #### def finalize(): Unit

    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )

17. #### def getAsyncPollPathFromId(id: String)(implicit request: Request[AnyContent]): AsyncPaths

    Definition Classes
      AsyncValidation

18. #### final def getClass(): Class[_]

    Definition Classes
      AnyRef → Any

19. #### def getSessionObject()(implicit request: Request[AnyContent]): Option[AsyncMvcSession]

    Definition Classes
      SessionHandler

20. #### def hashCode(): Int

    Definition Classes
      AnyRef → Any

21. #### final def isInstanceOf[T0]: Boolean

    Definition Classes
      Any

22. #### final def ne(arg0: AnyRef): Boolean

    Definition Classes
      AnyRef

23. #### final def notify(): Unit

    Definition Classes
      AnyRef

24. #### final def notifyAll(): Unit

    Definition Classes
      AnyRef

25. #### def pollTask(route: Call, callback: (OUTPUT) ⇒ (String) ⇒ Future[Result], callbackStatus: (AsyncMVC.this)#callbackWithStatusType)(implicit request: Request[AnyContent], hc: HeaderCarrier): Future[Result]

    Function used to verify if the async task has completed, if the async task has not completed the callbackStatus function will be invoked with a processing status value.

    Function used to verify if the async task has completed, if the async task has not completed the callbackStatus function will be invoked with a processing status value.

    route

      - Route if no async task is running. User could have deep-linked to a specific async controller action.

    callback

      - Invoked when the off-line Future completes.

    callbackStatus

      - Invoked when the client is responsible for rendering the display based on a status. This could be timeout, error...

    returns

      - Future[Result]

26. #### final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
      AnyRef

27. #### def toString(): String

    Definition Classes
      AnyRef → Any

28. #### final def wait(): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

29. #### final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

30. #### final def wait(arg0: Long): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

31. #### def waitForAsyncTask(route: Call, callback: (AsyncMVC.this)#callbackSuccessType, callbackStatus: (AsyncMVC.this)#callbackWithStatusType)(implicit request: Request[AnyContent], hc: HeaderCarrier): Future[Result]

    Function used in async blocking mode to not display the polling page when async task completes within expected wait period.

    Function used in async blocking mode to not display the polling page when async task completes within expected wait period.

    The client is redirected (http) to this function once the task has been submitted to the queue, the request will block for a short period of time before checking if the async task has completed. If the task has completed the callback function is invoked, otherwise callbackStatus is invoked to generate the poll page.

    route

      - Route to if no async task is running. User could have deep-linked to a specific async controller action.

    callback

      - Invoked when the off-line futureFunction completes.

    callbackStatus

      - Invoked when the client is responsible for rendering the display based on a status.

    returns

      - Future[Result]

32. #### def waitMode: Boolean

33. #### def withCorrespondingAsyncIdMatch(func: (Option[AsyncMvcSession]) ⇒ Future[Result])(implicit request: Request[AnyContent]): Future[Result]

    Function used to safe-guard the calling of the correct associated async controller function.

    Function used to safe-guard the calling of the correct associated async controller function. If the session async Id does not match the Id of the controller receiving the async request, the caller will be re-directed to the associated poll URL linked to the async Id.

    func

      - The function to invoke if the Id's match.

    request

      - The request.

    returns

      - Future[Result]

34. #### def wrap(message: String): String

    Definition Classes
      LogWrapper

### Inherited from AsyncValidation

### Inherited from SessionHandler

### Inherited from AsyncTask[OUTPUT]

### Inherited from LogWrapper

### Inherited from AnyRef

### Inherited from Any

### Ungrouped