Hello.
I'am a bit confused about the use cases of seastar::foreign_ptr in ScyllaDB or Seastar itself.
I understand what foreign pointer is and why should we use it in theory, but i can't figure out how can we use it in practice.
Let's assume we have to pass object to the other shard via foreign_ptr. It will be destroyed in it's own shard and all methods that we may call, should be called in it's own shard too (eg.: smp::submit_to(fp.
get_owner_shard(), [this] { return fp->do_some_work(); }); )
What could be the motivation to pass that object to the other shard? It makes no sense, because all operations with the object we do in the owner shard.
I would be very grateful if someone help me to clear it up using the real example from the seastar or scylla src code. I tried to do it myself, exploring multishard.cc and foreign_reader class, but it's a bit complicated for a such newbee like me.
Thank you!