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

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17854171#comment-17854171 ] 

ASF subversion and git services commented on PROTON-2830:
---------------------------------------------------------

Commit 59e779fa66b143dbbe586720e9f94871311574be in qpid-proton-dotnet's branch refs/heads/main from Timothy Bish
[ https://gitbox.apache.org/repos/asf?p=qpid-proton-dotnet.git;h=59e779f ]

PROTON-2830 Add an async version of BeginMessage to stream sender

Adds an async variant of the BeginMessage API to the IStreamSender to match
the other async variations of send and try send.


> [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
>
> 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