how to distinguish rpc called from which peer
ahczbhht1989 opened this issue · comments
pub trait FileSystem {
type Metadata;
fn new() -> Self;
#[rpc(name = "open_file")]
fn open_file(&self, file_name: String) -> Result<OpenFileResult>;
}
I have the rpc method open_file,I want to know which peer called open_file,and do somthing. How to do it.
You can use Metadata
to get information about the client. It would be necessary to implement MetaExtractor and use some of the data available in RequestContext
.
Thank you.Can you give me a example?