mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-20 14:57:45 +01:00
Merge pull request #2386 from KazWolfe/ipc-context
Some checks failed
Build Dalamud / Build on Windows (push) Waiting to run
Build Dalamud / Check API Compatibility (push) Blocked by required conditions
Build Dalamud / Deploy dalamud-distrib staging (push) Blocked by required conditions
Rollup changes to next version / check (api14) (push) Failing after 8s
Tag Build / Tag Build (push) Successful in 3s
Some checks failed
Build Dalamud / Build on Windows (push) Waiting to run
Build Dalamud / Check API Compatibility (push) Blocked by required conditions
Build Dalamud / Deploy dalamud-distrib staging (push) Blocked by required conditions
Rollup changes to next version / check (api14) (push) Failing after 8s
Tag Build / Tag Build (push) Successful in 3s
feat: Add IPC Context
This commit is contained in:
commit
8334836b6a
7 changed files with 157 additions and 63 deletions
|
|
@ -48,12 +48,20 @@ internal class PluginIpcWidget : IDataWindowWidget
|
|||
|
||||
this.ipcPub.RegisterAction(msg =>
|
||||
{
|
||||
Log.Information("Data action was called: {Msg}", msg);
|
||||
Log.Information(
|
||||
"Data action was called: {Msg}\n" +
|
||||
" Context: {Context}",
|
||||
msg,
|
||||
this.ipcPub.GetContext());
|
||||
});
|
||||
|
||||
this.ipcPub.RegisterFunc(msg =>
|
||||
{
|
||||
Log.Information("Data func was called: {Msg}", msg);
|
||||
Log.Information(
|
||||
"Data func was called: {Msg}\n" +
|
||||
" Context: {Context}",
|
||||
msg,
|
||||
this.ipcPub.GetContext());
|
||||
return Guid.NewGuid().ToString();
|
||||
});
|
||||
}
|
||||
|
|
@ -61,14 +69,8 @@ internal class PluginIpcWidget : IDataWindowWidget
|
|||
if (this.ipcSub == null)
|
||||
{
|
||||
this.ipcSub = new CallGatePubSub<string, string>("dataDemo1");
|
||||
this.ipcSub.Subscribe(_ =>
|
||||
{
|
||||
Log.Information("PONG1");
|
||||
});
|
||||
this.ipcSub.Subscribe(_ =>
|
||||
{
|
||||
Log.Information("PONG2");
|
||||
});
|
||||
this.ipcSub.Subscribe(_ => { Log.Information("PONG1"); });
|
||||
this.ipcSub.Subscribe(_ => { Log.Information("PONG2"); });
|
||||
this.ipcSub.Subscribe(_ => throw new Exception("PONG3"));
|
||||
}
|
||||
|
||||
|
|
@ -78,12 +80,21 @@ internal class PluginIpcWidget : IDataWindowWidget
|
|||
|
||||
this.ipcPubGo.RegisterAction(go =>
|
||||
{
|
||||
Log.Information("Data action was called: {Name}", go?.Name);
|
||||
Log.Information(
|
||||
"Data action was called: {Name}" +
|
||||
"\n Context: {Context}",
|
||||
go?.Name,
|
||||
this.ipcPubGo.GetContext());
|
||||
});
|
||||
|
||||
this.ipcPubGo.RegisterFunc(go =>
|
||||
{
|
||||
Log.Information("Data func was called: {Name}", go?.Name);
|
||||
Log.Information(
|
||||
"Data func was called: {Name}\n" +
|
||||
" Context: {Context}",
|
||||
go?.Name,
|
||||
this.ipcPubGo.GetContext());
|
||||
|
||||
return "test";
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue