[ 
https://issues.apache.org/jira/browse/ISIS-1960?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16499816#comment-16499816
 ] 

ASF subversion and git services commented on ISIS-1960:
-------------------------------------------------------

Commit 272a6198a28d643a8f5ef8e0519ee6a154caecbe in isis's branch 
refs/heads/master from [~hobrom]
[ https://gitbox.apache.org/repos/asf?p=isis.git;h=272a619 ]

ISIS-1960: Adding background error handling

also init thread-pool only if required

Task-Url: https://issues.apache.org/jira/browse/ISIS-1960

> Action background execution: provide built-in default implementation
> --------------------------------------------------------------------
>
>                 Key: ISIS-1960
>                 URL: https://issues.apache.org/jira/browse/ISIS-1960
>             Project: Isis
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Andi Huber
>            Assignee: Andi Huber
>            Priority: Major
>             Fix For: 2.0.0-M1
>
>
> We want this code to run out-of the box (without the need for developers to 
> provide their own implementation of *BackgroundCommandService*) ...
> {code:java}
> @Inject private BackgroundService2 backgroundService;
> @Action
> public SimpleObject runSlowlyInBackground(){
>       backgroundService.execute(this).runSlowly();
>       return this;
> }
>     
> @Action
> public SimpleObject runSlowly(){
>       try {
>               Thread.sleep(8000); // wait 8s
>       } catch (InterruptedException e) {
>               e.printStackTrace();
>       }       
>       
>       val dummy = new SimpleObject();
>       dummy.setName("Dummy");
>       
>       repositoryService.persist(dummy);
>       
>       return this;
> }
> {code}
> We solve this using a default ExecutorService to run Action invocations in 
> the background.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to