Thrift IDL Support
Overview
The "stx:goodies/thrift" package implements the low level transport and RPC
interface to comunicate with applications based on the thrift (apache.org)
framework. This allows to perform RPC calls and communicate with applications
like the Cassandra Database and others.
Documentation
see the README files in 'goodies/thrift'.
Use the source - Luke.
Release Notes
The original gen-st package as found in the apache repository contains
a number of bugs and limitations, which have been fixed in this package.
- thrift.exe - the generated code (aka. when creating foo.st from foo.thrift) has some minor bugs in it (refers to oprot in read methods,
flushes oprot in read methods, has squeak dependencies hardwired into it).
- thrift.st - does not support the current standard FramedTransport. I.e. it was useless with todays thrift apps, as
the old SimpleTransport is no longer supported by any server.
To fix these, the corresonding generator code (in c-plusplus) needs to be rewritten
and also parameters/flags should be added to it to allow for different Smalltalk dialects to
be supported.
As we do not like C++, a post-processor was written, which takes the original thrift
output and rewrites the ST code to fit our needs.
Additional Protocol Support
The package has beed changed to allow for the transport to be specified in the
client creation message. Also, a TFramedTransport was added, which is now the default.
Support for the CompactProtocol is being developed but currently unfinished.
Usage Example
To generate the interface client from a "foo.thrift" IDL description, perform the
following steps:
- load the thrift package into ST/X (i.e. "
Smalltalk loadPackage:'stx:goodies/thrift'
").
- download the thrift compiler (thrift.exe) from apache.org.
- execute "thrift.exe foo.thrift"
- fileIn the resulting st file ("gen-st/foo.st"). This should give you a class called "FooClient".
- in a workspace, execute the post-processor: "
ThriftFixup fixupClass:FooClient
"
- done
No Warranty
This goody is provided AS-IS without any warranty whatsoever.
Origin/Authors
Claus Gittinger
<info@exept.de>
Doc $Revision: 1.3 $