[
https://issues.apache.org/jira/browse/THRIFT-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13903278#comment-13903278
]
Ben Craig commented on THRIFT-2366:
-----------------------------------
I think I would implement this at the transport level. Basically have a
'ctypes' or 'JNI' transport. When flush is called on the output transport, it
would send the buffer to the "lower" language, which could call the processor.
When the "lower" language is done, it would return a buffer back up. That
returned buffer would be filled in during the "output" flush, and the input
recv functions would extract data from it.
> Running Thrift in a single process / as a foreign function interface
> --------------------------------------------------------------------
>
> Key: THRIFT-2366
> URL: https://issues.apache.org/jira/browse/THRIFT-2366
> Project: Thrift
> Issue Type: Improvement
> Reporter: Eric Christiansen
>
> I propose Thrift be enhanced by allowing the server and client to exist in
> the same thread.
> The user semantics would be similar to foreign function interfaces, such as
> those generated by SWIG.
> Please see this SO question:
> http://stackoverflow.com/questions/21211749/running-apache-thrift-in-a-single-process-as-a-foreign-function-interface
> Use case 1:
> Bob writes a CLI Python app that depends on C++ code.
> His users integrate his app into shell scripts, and are happy they don't have
> to worry about starting and stopping a Thrift server.
> Use case 2:
> Alice is an iOS developer who wants to combine Haskell and C.
> Forking processes isn't allowed in iOS, so before she couldn't start a Thrift
> server and get the desired combination.
> But now everything can live in a single thread, so she gets her polyglot
> programming.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)