You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Timothy A. Bish (Jira)" <ji...@apache.org> on 2024/06/11 19:30:00 UTC

[jira] [Resolved] (PROTON-2830) [proton-dotnet] ClientStreamSender lacks async variant of BeginMessage

     [ https://issues.apache.org/jira/browse/PROTON-2830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy A. Bish resolved PROTON-2830.
-------------------------------------
    Fix Version/s: proton-dotnet-1.0.0-M11
       Resolution: Fixed

> [proton-dotnet] ClientStreamSender lacks async variant of BeginMessage
> ----------------------------------------------------------------------
>
>                 Key: PROTON-2830
>                 URL: https://issues.apache.org/jira/browse/PROTON-2830
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-dotnet
>    Affects Versions: proton-dotnet-1.0.0-M10
>            Reporter: Yuriy Lepikhov
>            Assignee: Timothy A. Bish
>            Priority: Minor
>             Fix For: proton-dotnet-1.0.0-M11
>
>
> ClientStreamSender.BeginMessage is blocking and shouldn't be called in EventLoop callback.
> Call of ClientStreamSender.BeginMessage from EventLoop callback leads to deadlock.
> For example:
> {code:java}
> using var sender = await connection.OpenStreamSenderAsync(address).ConfigureAwait(false);
> // coninuation will be executed in EventLoop callback, but BeginMessage publishes event to EventLoop and blocks = deadlock
> var message = sender.BeginMessage(); {code}
> In general it is good idea not to mix sync and async calls, and BeginMessageAsync would help in this situation.
>  
> Also, is it necessary to introduce new API such as EventLoop whereas TaskFactory already exists?
> May be something like this would be useful:
> {code:java}
> ConcurrentExclusiveSchedulerPair concurrentExclusiveSchedulerPair = new ConcurrentExclusiveSchedulerPair(TaskScheduler.Default, 1, 1);
> TaskFactory taskFactory = new TaskFactory(concurrentExclusiveSchedulerPair.ExclusiveScheduler);
> // ... 
> taskFactory.StartNew(...); {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org