With callbacks you will smear code over two methods: caller, callback.
Also you will need to keep some state! AFAIU coroutins solve this
problem in more elegant manner using saving running context. Operator
A push a portion of data to pipe and *goto* operator B which pull the
portion process it and push the result to the next operator. In some
time operator A get CPU again and produce neew portion. Note: every
operator located in SINGLE place of code, but you keep pipeline
(streams) whithout huge buffers.

2016-10-26 17:51 GMT+03:00 Dimitry Sibiryakov <s...@ibphoenix.com>:
> 26.10.2016 16:41, Adriano dos Santos Fernandes wrote:
>> We can't *callback* our caller.
>
>    Why not? It is a matter of adding one method to your new API:
>
> class IEater
> {
>         int pushData(IMessageMetadata* metadata, void* buffer);
> };
>
> IStatus* IAttachment::execute(const char* SQL, IMessageMetadata* 
> inputMetadata, void*
> inputData, IEater* outputCallback);
>
>
> --
>    WBR, SD.
>
> ------------------------------------------------------------------------------
> The Command Line: Reinvented for Modern Developers
> Did the resurgence of CLI tooling catch you by surprise?
> Reconnect with the command line and become more productive.
> Learn the new .NET and ASP.NET CLI. Get your free copy!
> http://sdm.link/telerik
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel



-- 
С уважением
Роман Симаков
Директор департамента развития системных продуктов
ООО "Ред Софт"

skype: simakov_roman
www.red-soft.ru

------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to