Skip to content

Commit

Permalink
#813 Memory.Unpack
Browse files Browse the repository at this point in the history
  • Loading branch information
zhabis committed Jan 26, 2023
1 parent 0374685 commit 001202a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/Azos.Sky.Server/Fabric/Server/FiberMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public void WriteOneWay(BixWriter writer)
private int m_StateOffset;
private Exception m_CrashException;


public int Version => m_Version;
public MemoryStatus Status => m_Status;
public FiberId Id => m_Id;
Expand Down Expand Up @@ -133,5 +132,10 @@ public FiberMemoryDelta MakeDeltaSnapshot(FiberStep? nextStep)
return null;
}

public (FiberParameters pars, FiberState state) Unpack(Type tParameters, Type tState)
{
return (null, null);
}

}
}
13 changes: 10 additions & 3 deletions src/Azos.Sky.Server/Fabric/Server/FiberProcessorDaemon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,17 @@ private void reportUnknownImage(Guid guid)
Fiber fiber = null;
try
{
var (tParemeters, tState) = FIBER_STATE_TYPES_MAP_CACHE[tFiber];
//Resolve types of Fiber generic arguments
var (tParameters, tState) = FIBER_STATE_TYPES_MAP_CACHE[tFiber];

//Deserialize parameters and state
var (fiberParameters, fiberState) = memory.Unpack(tParameters, tState);

//Make fiber
fiber = (Fiber)Serialization.SerializationUtils.MakeNewObjectInstance(tFiber);
//obtain state and parameters materialize(TParams, tState);
fiber.__processor__ctor(m_Runtime, null /*memory.Parameters*/, null/*memory.State*/);

//Init inject
fiber.__processor__ctor(m_Runtime, fiberParameters, fiberState);
}
catch(Exception allocationError)
{
Expand Down

0 comments on commit 001202a

Please sign in to comment.