How to implement undo in Spring REST API -


i need ideas on how implement simple undo function. spring web-app js frontend , typical spring rest api. undo feature should work similar undo in google keep, e.g. user clicks delete, ui appears delete object, small popup appears in corner undo link approximately 10 sec, after disappears , undo no longer available.

my initial thoughts use async message queue. perhaps commandqueue , undocommandqueue. when message enters commandqueue delayed 10sec. after delay service activator recieves message , checks see if there corresponding undo message in undocommandqueue matching id, if not proceeds delete.

if possible(and not more complicated) i'd avoid using msg queue. perhaps async delete method has 10 sec sleep built in. how notify async method after it's done sleeping separate undo rest api call made?

i know command pattern de-facto approach undo, given want 1 level of undo short amount of time seems overkill. simplest solution delay delete api call altogether using javascript on frontend, issue in scenarios closing browser(so api never gets called).

anyone done before? suggestions? thanks!


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -