Skip to content

Instantly share code, notes, and snippets.

@ScriptByte
Created January 17, 2013 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ScriptByte/4558506 to your computer and use it in GitHub Desktop.
Save ScriptByte/4558506 to your computer and use it in GitHub Desktop.
@Service
public class SomeServiceBean {
@Autowired
LongJobService longJobService;
void runLongJob() {
longJobService.longJob();
}
}
@Service
public class LongJobService {
@Async
public void longJob() {
// This block of code will run asynchronously
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment