Hi guys, Thanks for your feedback James, I can expose another method - lets say *void resume(uint ms) *that will schedule it for the user, sounds good?
Brian, I want to buffer to a certain limit and when the 'Content-Length' header is missing we can't know the file size, so we'll start buffering to file while keeping track on the aggregated size. If we figure out that the file size is greater than the limit then we'd like to pass on the analysis and just consume all the data. For that we first need to produce all the file data (Read chunks of it and consume it * N times), that's why we need to pause the transformation we don't want to start buffering the data that keeps on coming while we consume the file, when we are done consuming the file we can resume the transformation and consume the rest of the data. Thanks On Wed, Jun 22, 2016 at 3:59 AM Brian Geffon <briangef...@gmail.com> wrote: > The thing I'm missing about this, why can't you just keep buffering to the > same file while you're doing analysis? I don't see why you need to pause > anything? > > Brian > > On Friday, June 17, 2016, David Ben Zakai <david.benza...@gmail.com> > wrote: > > > Hi all, > > > > I'd like to suggest an API change in the CPP API Transformation > interface. > > > > My own use case is that I'd like to be able to pause the transformation, > > handle what I can from the file and release the buffered content before > > resuming and releasing the rest of the data. > > Basically what I'm trying to achieve: > > > > 1. Write data to file (up to a certain amount) > > 2. File analysis > > 3. Produce file data (and any leftovers) downstream > > > > When the file size reaches a certain size limit I'd like to be able to > > pause the transformation and produce all of its content downstream and > then > > resume the transformation. > > > > API Changes: > > TransformationPlugin.h: > > /** > > * Call this method if you wish to pause the transformation. > > * Schedule the return value continuation to resume the transforamtion. > > * If the continuation is scheduled and called after the transform is > > destroyed it will > > * won't do anything beyond cleanups. > > * Note: You must schedule the continuation or destroy it (using > > TSContDestroy) yourself, > > * otherwise it will leak. > > */ > > TSCont pause(); > > > > Internally, the continuation wraps the "resumeCallback" static function: > > static int resumeCallback(TSCont cont, TSEvent event, void *edata); /** > > Resume callback*/ > > > > You can view my jira issue here > > <https://issues.apache.org/jira/browse/TS-4523> > > You can view my pull request here > > <https://github.com/apache/trafficserver/pull/712>. > > > > Thank you! > > >