-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support synchronous methods #2
Comments
sorry i accidentally clicked closed lol |
Maybe could use shutdown hook to terminate Thread Pool in the end of the program, but It more looks like a punt than a solution. |
There are some methods which only gives asynchronous option.
Like delete method in JMailTM class, or save method in Attachment class.
For me it looks like a good idea to give a synchronous version of this method.
It doesn't look a hard task to do since these methods have similar format(just some code snippet surrounded by
new Thread(new Runnable() { ... }).start();
).So I'll be happy to do some contribution myself, but I'm not sure what is best option to achieve the goal.
1. Just make new synchronous method named like
deleteNow
XX(Asynchronous)
<->XXNow(Synchronous)
naming pattern doesn't match existing code likeasyncXX(Asynchronous)
<->XX(Synchronous)
(see fetchMessages)2. Follow existing naming pattern
3. Make
delete
method returnsFuture
objectsubmit
method will return aFuture
object.WorkCallback
class will be easily changed toFuture<Boolean>
jmailtmObjectList.stream().foreach(JMailTM::delete)
) will result an error.What would be the best option?
The text was updated successfully, but these errors were encountered: