Skip to content

Commit

Permalink
Merge pull request #83 from AGeorgy/master
Browse files Browse the repository at this point in the history
added Buffered overloads of GetSubscriber, GetPublisher to GlobalMessagePipe
  • Loading branch information
neuecc authored Jun 23, 2022
2 parents 1ff8f63 + aaf9db8 commit 0a69940
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,30 @@ public static IAsyncRequestAllHandler<TRequest, TResponse> GetAsyncRequestAllHan
return provider.GetRequiredService<IAsyncRequestAllHandler<TRequest, TResponse>>();
}

public static IBufferedPublisher<TMessage> GetBufferedPublisher<TMessage>()
{
ThrowIfNotInitialized();
return provider.GetRequiredService<IBufferedPublisher<TMessage>>();
}

public static IBufferedSubscriber<TMessage> GetBufferedSubscriber<TMessage>()
{
ThrowIfNotInitialized();
return provider.GetRequiredService<IBufferedSubscriber<TMessage>>();
}

public static IBufferedAsyncPublisher<TMessage> GetAsyncBufferedPublisher<TMessage>()
{
ThrowIfNotInitialized();
return provider.GetRequiredService<IBufferedAsyncPublisher<TMessage>>();
}

public static IBufferedAsyncSubscriber<TMessage> GetAsyncBufferedSubscriber<TMessage>()
{
ThrowIfNotInitialized();
return provider.GetRequiredService<IBufferedAsyncSubscriber<TMessage>>();
}

#if !UNITY_2018_3_OR_NEWER

public static IDistributedPublisher<TKey, TMessage> GetDistributedPublisher<TKey, TMessage>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "com.cysharp.messagepipe",
"displayName": "MessagePipe",
"author": { "name": "Cysharp, Inc.", "url": "https://cysharp.co.jp/en/" },
"version": "1.7.3",
"version": "1.7.4",
"unity": "2018.4",
"description": "High performance messaging pipeline.",
"keywords": [ "pubsub", "event", "Scripting", "DI" ],
Expand Down
24 changes: 24 additions & 0 deletions src/MessagePipe/GlobalMessagePipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,30 @@ public static IAsyncRequestAllHandler<TRequest, TResponse> GetAsyncRequestAllHan
return provider.GetRequiredService<IAsyncRequestAllHandler<TRequest, TResponse>>();
}

public static IBufferedPublisher<TMessage> GetBufferedPublisher<TMessage>()
{
ThrowIfNotInitialized();
return provider.GetRequiredService<IBufferedPublisher<TMessage>>();
}

public static IBufferedSubscriber<TMessage> GetBufferedSubscriber<TMessage>()
{
ThrowIfNotInitialized();
return provider.GetRequiredService<IBufferedSubscriber<TMessage>>();
}

public static IBufferedAsyncPublisher<TMessage> GetAsyncBufferedPublisher<TMessage>()
{
ThrowIfNotInitialized();
return provider.GetRequiredService<IBufferedAsyncPublisher<TMessage>>();
}

public static IBufferedAsyncSubscriber<TMessage> GetAsyncBufferedSubscriber<TMessage>()
{
ThrowIfNotInitialized();
return provider.GetRequiredService<IBufferedAsyncSubscriber<TMessage>>();
}

#if !UNITY_2018_3_OR_NEWER

public static IDistributedPublisher<TKey, TMessage> GetDistributedPublisher<TKey, TMessage>()
Expand Down

0 comments on commit 0a69940

Please sign in to comment.