M
M
Maxim Vasiliev2013-05-12 06:32:45
Programming
Maxim Vasiliev, 2013-05-12 06:32:45

Retrying execution after failure?

What is the name of a language construct (pattern) that allows you to repeat the execution of a code fragment when a failure (exception) occurs during its execution.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
rasa, 2013-05-12
@rasa

Many solve this with regular cycles. But you are not looking for a solution, but a name ?

K
kk86, 2013-05-12
@kk86

Naturally, a simple cycle or "schedule" of tasks will underlie the method. It's hard to think of anything else.
Let's imagine that you have an application that allows the user to upload images from their phone to some storage. Obviously, the Internet is not always fast and reliable. I would like to ensure the possibility of guaranteed loading of new pictures, without waiting for the download of each individual one.
The "guaranteed download" requirement says that an entity is needed that will be responsible for monitoring the success of the download and for initiating a retry if the previous one failed. Unfortunately, I do not know the name of the entity and the pattern. The requirement to be able to load in parallel means that requests must be executed asynchronously.
Now let's imagine that in the process of downloading the phone's battery is discharged. This is the nuance. Ideally, the scheduler stores a list of tasks in ROM. For example, the scheduler can save a list of images to be downloaded to a file on disk and “delete” those that were successfully downloaded from there.
Perhaps there is something ready, but I have not met, to be honest.

M
Maxim Vasiliev, 2013-05-12
@qmax

For example, in Lisp:
www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_restart-case.html
chaitanyagupta.com/lisp/restarts.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question