> On Jun 16, 2016, at 11:43 AM, 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();

This seems like a useful capability, but it strikes me as a little awkward that 
you have to use TSContSchedule() to resume?

> 
> 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!

Reply via email to