You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also add ability to execute callbacks on main (UI) thread with a constructor switch.
Make it possible for user to supply their own ExecutorService.
Callback Execution
Using AsyncHandler callbacks is ideal for updating a UI with the result of an operation. Keep in mind though that your implementation of AsyncHandler is executed inside the thread pool owned by the asynchronous client. Short, quickly executed code is most appropriate inside your AsyncHandler implementation. Long running or blocking code inside the AsyncHandler implementation can cause contention for the thread pool used by the asynchronous client and can prevent the client from being able to execute requests. If you have a long-running task that needs to begin from a callback, then simply have the callback run the task in a new thread or another thread pool managed by your application.
Thread Pool Configuration
The asynchronous clients in the SDK provide a default thread pool that should work for most applications, but you are also free to supply your own ExecutorService to the asynchronous clients if you want more control over how the thread pools are managed. For example, you could provide your own ExecutorService that uses a custom ThreadFactory to control how threads in the pool are named or to log additional information about thread usage.
Amazon S3 Asynchronous Access
The TransferManager class in the SDK offers asynchronous support for working with the Amazon Simple Storage Service (Amazon S3). The TransferManager manages asynchronous uploads and downloads, provides detailed progress reporting on transfers, and supports callbacks into different events.
As ws.sendMessage will throw if called from another thread when busy writing stuff. Also it is a waste to create a thread per request.
The text was updated successfully, but these errors were encountered: