private static TSignal makeDefault <TSignal>(ISkyApplication app, TSignal signal, PID pid) where TSignal : Signal { app.DependencyInjector.InjectInto(signal); signal.m_SysID = app.GdidProvider.GenerateOneGdid(SysConsts.GDID_NS_WORKER, SysConsts.GDID_NAME_WORKER_SIGNAL); signal.m_SysPID = pid; signal.m_SysTimestampUTC = app.TimeSource.UTCNow; signal.m_SysAbout = "{0}@{1}@{2}".Args(Ambient.CurrentCallUser.Name, app.Name, app.HostName); return(signal); }
public void ____Deserialize(GDID id, PID pid, DateTime ts, string about) { m_SysID = id; m_SysPID = pid; m_SysTimestampUTC = ts; m_SysAbout = about; }
/// <summary> /// Factory method that creates new Signal based on provided PID /// </summary> public static TSignal MakeNew <TSignal>(IApplication app, PID pid) where TSignal : Signal, new() { return(makeDefault(app.AsSky(), new TSignal(), pid)); }
/// <summary> /// Factory method that creates new Signal based on provided Type, PID and Configuration /// </summary> public static Signal MakeNew(IApplication app, Type type, PID pid, IConfigSectionNode args) { return(makeDefault(app.AsSky(), FactoryUtils.MakeAndConfigure <Signal>(args, type), pid)); }
protected abstract TProcess DoGet <TProcess>(PID pid) where TProcess : Process;
protected abstract ProcessDescriptor DoGetDescriptor(PID pid);
public TProcess Get <TProcess>(PID pid) where TProcess : Process { return(DoGet <TProcess>(pid)); }
public ProcessDescriptor GetDescriptor(PID pid) { return(DoGetDescriptor(pid)); }
public ResultSignal Dispatch(PID pid, IConfigSectionNode args, Guid type) { return(Dispatch(pid, args, SignalTypeResolver.Resolve(type))); }
public Task <ResultSignal> Async_Dispatch(PID pid, IConfigSectionNode args, Guid type) { return(Async_Dispatch(pid, args, SignalTypeResolver.Resolve(type))); }
public Task Async_Spawn(PID pid, IConfigSectionNode args, Guid type) { return(Async_Spawn(pid, args, ProcessTypeResolver.Resolve(type))); }
public void Spawn(PID pid, IConfigSectionNode args, Guid type) { Spawn(pid, args, ProcessTypeResolver.Resolve(type)); }
private static TProcess makeDefault <TProcess>(ISkyApplication app, TProcess process, PID pid) where TProcess : Process { app.DependencyInjector.InjectInto(process); var attr = GuidTypeAttribute.GetGuidTypeAttribute <Process, ProcessAttribute>(process.GetType()); var descriptor = new ProcessDescriptor( pid, attr.Description, app.TimeSource.UTCNow, "{0}@{1}@{2}".Args(Ambient.CurrentCallUser.Name, app.Name, app.HostName)); process.m_SysDescriptor = descriptor; return(process); }
/// <summary> /// Factory method that creates new Process based on provided Type, PID and Configuration /// </summary> public static Process MakeNew(IApplication app, Type type, PID pid, IConfigSectionNode args) => makeDefault(app.AsSky(), FactoryUtils.MakeAndConfigure <Process>(args, type), pid);
/// <summary> /// Factory method that creates new Process based on provided PID /// </summary> public static TProcess MakeNew <TProcess>(IApplication app, PID pid) where TProcess : Process, new() => makeDefault(app.AsSky(), new TProcess(), pid);