question

Upvotes
Accepted
1 0 0 0

How to clone Msg in C# in the onUpdateMsg handler?

In C# as there is no EmaFactory how do we clone Msg?

We are using the pub / sub pattern to offload to other threads for processing.

We are currently trying this :

var clonedMsg = new RefreshMsg(msg);

but we still seem to get a dead lock when accessing fields on the clonedMsg on a different thread.

#technologyema-apic#
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
23.1k 60 15 21

Hello @andrewjamesfry,

The Update message has a Clone() method which you can use to get your own copy of original update message.


1715003200833.png


1715003200833.png (22.4 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.