collectiveidea / interactor

Interactor provides a common interface for performing complex user interactions.
MIT License
3.36k stars 212 forks source link

Add ensure hook #147

Open ayrat555 opened 7 years ago

ayrat555 commented 7 years ago

Sometimes there are situations when an interactor operates with sensible resources, for example, with files. In my opinion, we should have a mechanism to do a final processing on that resources in case an error occurs.

Currently I'm creating a lot of files in my system, location of that files are calculated during execution of interactor and they are available only through interactor's context. So deleting them with ensure_hook solves my problem.

I hope this feature will be useful.

P.S. I will add more tests and docs if everything is ok.

ayrat555 commented 7 years ago

@laserlemon what is your opinion?

danlo commented 6 years ago

+1