I'm interested in running some server-side code in Rails only after a page has been flushed to a client (similar to the question asked here for Django). Arguably, what I'm looking for is functionality equivalent to Django's request_finished signal for Rails.
I've found callback support for ActiveRecord (which acts on persistance to the database, rather than on request status), and tools for deferring a long-running task intended to allow a page response to complete (but which make no effort no support starting that task only after a page is flushed to the client).
[The immediate use case is processing a user-requested action which can disrupt the running service; the goal is to get the current page out to the client before proceeding with that disruptive action, without anything so race-prone and generally hacky as a hardcoded delay].
Is what I'm trying to accomplish possible? My target is Rails 4.x.