ObjectRef and std::future

Hello everyone,

I have a problem using ObjectRef and structs that contain std::future objects inside of them:

The current plan is to build an profiling backend similiar to the existing PAPI one that allows the usage of bench devices through the VISA API, to enable power measurements and other stuff on embedded boards. For this I trigger an async event in the start function and store the std::future in a struct. The ObjectRef of this struct is than past on to the Stop function, but when I try to get the result there, I cannot do it as object.as() is a const and std::future.get() cannot be constant.

It looks like I am missing something obvious I get, but what is TVM’s solution for this situations? Or how could I change my approach here?