Vasiu Alexandru
Vasiu Alexandru

Reputation: 123

How to use a service as a type in Thrift

When I compile this example.thrift file with command thrift-0.11.0.exe --gen charp .\example.thrift I got this error: Type "Interface1" not defined

service Interface1 
{
    void add(1:list<string> a)
}

service Interface2
{
    bool isThere(1:Interface1 item)
}

How to use Interface1 as a type of a method in Interface2?

Upvotes: 0

Views: 145

Answers (1)

codeSF
codeSF

Reputation: 1172

Passing interface references is not supported in Apache Thrift. You could pass a struct with a service end point (hostname/ip, port and service name) however, then the receiver could use those coordinates to make a call back if that is what you are after.

Upvotes: 2

Related Questions