Search code examples
thrift

Passing Thrift service as argument


Is it possible to pass a service as an argument to a method in another service in Thrift?

service MyService {
  void foo(1: MyOtherService),
}

service MyOtherService {
  void bar(),
}

Solution

  • Service isn't Thrift serializable (in other words: no sense to transmit service via network - Your foo function to be executed on remote machine with transmitted arguments).

    I think not.

    What is real goal? I have intuition You want good OO pattern. Is this kind of parametrisation?