I'm having some difficulty finding a way to expire the cache after
executing an asynchronous BackgroundRB task. From a Rails controller I
fire off an async worker which will handle importing of data from a file
and, when completed, the fragment cache of a page needs to be expired.
I've tried ...
1. Simply calling expire_action from within the BackgroundRB worker.
However, it appears that BackgroundRB doesn't have access to
2. Using sweepers/observers on the model object being changed by the
BackgroundRB worker. The BackgroundRB worker will do some stuff with
the model object, the observer will catch this, and the sweeper will
handle expiring the cache. However, the sweeper complains that the
record passed to the after_whatever callback methods is nil. Without
this model object I can't expire the correct cache.
Using Rails 2.1 and the absolute latest BackgroundRB from github.