We have the same scenario here. What we do is delegate to a ExecutorService
the execution (pardon me) of the given task. Since it's an asynchronous job,
you can reply to the client and process it on a separate thread. The client
then gets the response from the ftp, and since the execution is still
running, we later add a file with a .ok extension to inform the client that
the process went right

Regards

On Wed, Mar 3, 2010 at 7:12 PM, Dan <[email protected]> wrote:

> We would like to perform some file processing once a file has been uploaded
> but it seems that if we use an Ftplet and implement onUploadEnd() then that
> won't block (i.e. the client will think the file has been successfully
> uploaded)
>
> We need something like:
>
> 1. Client uploads a file
> 2. File upload complete, processing starts
> 3. Processing finished, OK result sent back to client
>
> One problem is that the processing in #2 can take some time (minutes even)
> and FTP clients assume a failure has happened since no reply has been
> received.
>
> Any thoughts on how you can block, do your processing, and then commit a
> response back to the client?
>
> Thanks,
>
> Dan
>
>

Reply via email to