{"action":"closed","issue":{"url":"https://api.github.com/repos/jdeferred/jdeferred/issues/72","repository_url":"https://api.github.com/repos/jdeferred/jdeferred","labels_url":"https://api.github.com/repos/jdeferred/jdeferred/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/jdeferred/jdeferred/issues/72/comments","events_url":"https://api.github.com/repos/jdeferred/jdeferred/issues/72/events","html_url":"https://github.com/jdeferred/jdeferred/issues/72","id":142565256,"number":72,"title":"Notify progress","user":{"login":"tyteen4a03","id":440015,"avatar_url":"https://avatars.githubusercontent.com/u/440015?v=3","gravatar_id":"","url":"https://api.github.com/users/tyteen4a03","html_url":"https://github.com/tyteen4a03","followers_url":"https://api.github.com/users/tyteen4a03/followers","following_url":"https://api.github.com/users/tyteen4a03/following{/other_user}","gists_url":"https://api.github.com/users/tyteen4a03/gists{/gist_id}","starred_url":"https://api.github.com/users/tyteen4a03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyteen4a03/subscriptions","organizations_url":"https://api.github.com/users/tyteen4a03/orgs","repos_url":"https://api.github.com/users/tyteen4a03/repos","events_url":"https://api.github.com/users/tyteen4a03/events{/privacy}","received_events_url":"https://api.github.com/users/tyteen4a03/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jdeferred/jdeferred/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-22T06:58:24Z","updated_at":"2016-04-12T20:03:18Z","closed_at":"2016-04-12T20:03:18Z","body":"How do I notify the progress from a Deferred object? I have the following code:\r\n\r\n        Deferred<String, Exception, String> d = new DeferredObject<>();\r\n        Promise<String, Exception, String> p = d.promise();\r\n        new Thread(() -> {\r\n            for (String name : names) {\r\n                String expensiveOperationStepOutput = reallyExpensiveFunction(name)\r\n                d.notify(\"Actual notification\");\r\n                System.out.println(\"Notified\");\r\n            }\r\n            d.resolve(\"done\");\r\n        }).run();\r\n        return p;\r\n\r\nAnd then somewhere I do:\r\n\r\n        Promise<String, Exception, String> p = sm.fetchExpensiveThings();\r\n        p.then(result -> {\r\n            System.out.println(\"Done!\");\r\n        });\r\n        p.progress(progress -> System.out.println(\"Called!\"));\r\n\r\nBut when I run the above code, I see a lot of \"Notified\" and a \"Done\" at the end, but never \"Called\". How do I do this?"}}