Tasks registered via the RPC can have their results optionally streamed to the clients without them having to hit ::status method.
Clients may rely on streaming in a way that they never make use of ::status all together (unless maybe when the expected streaming result didn't arrive for so long).
This means that we will ever call self.task_status(task_id, false):
https://github.com/KomodoPlatform/komodo-defi-framework/blob/a295579b8b29815f5aa2d8a999c992bbbec754a8/mm2src/rpc_task/src/manager.rs#L190-L193
and the task result will be stored/cached indefinitely through KDFs session life time.
We should rather convert the tasks Map to a TimedMap instead that will remove the task results that has been sitting there for an hour or so. This also means that forgotten tasks from clients will not cause memory leak in KDF.
Tasks registered via the RPC can have their results optionally streamed to the clients without them having to hit
::statusmethod.Clients may rely on streaming in a way that they never make use of
::statusall together (unless maybe when the expected streaming result didn't arrive for so long).This means that we will ever call
self.task_status(task_id, false):https://github.com/KomodoPlatform/komodo-defi-framework/blob/a295579b8b29815f5aa2d8a999c992bbbec754a8/mm2src/rpc_task/src/manager.rs#L190-L193
and the task result will be stored/cached indefinitely through KDFs session life time.
We should rather convert the
tasksMapto aTimedMapinstead that will remove the task results that has been sitting there for an hour or so. This also means that forgotten tasks from clients will not cause memory leak in KDF.