paleolimbot / geos

Open Source Geometry Engine ('GEOS') R API
https://paleolimbot.github.io/geos/
Other
61 stars 7 forks source link

Check user interrupt in geos_distance_indexed #40

Open paleolimbot opened 3 years ago

paleolimbot commented 3 years ago

(Reminding myself that this is hard to do because you can't longjmp from the callback)

paleolimbot commented 3 years ago

Punting for now, but one could check this by unwind-protecting or try/catch on R_CheckUserInterrupt()...the trick would be figuring out how to do it intermittently (maybe through a global variable). You can return 0 from the callback to stop processing and throw an error.

paleolimbot commented 2 years ago

This can be done much more easily in C++ using cpp11 infrastructure...for now it would need a C-level unwind protect I think.