Thrift doesn't have direct support for varargs. There are some ways you
can fake it depending on your use case.
If you want a 'printf' like function, your best bet is to do something
like this...
void printf(1:string format, 2:string vararg_bytes);
Your implementation would then need to pull the data you need out of the
vararg_bytes string.
If you want to occasionally omit some arguments, then look at optional
struct members. For example:
struct Work {
1: i32 num1 = 0,
2: i32 num2,
3: Operation op,
4: optional string comment,
}
void sendWork(1: Work w)
From: Victor L <[email protected]>
To: [email protected],
Date: 01/26/2015 06:05 AM
Subject: varargs service declarations?
Hi,
How can i implement service with variable number of arguments?
Thks,