You can use the TaskWhenAllPublisher to publish all notifications at once with MediatR. You can get a performance improvement. But you should be mindful of concurrency conflicts. Handling exceptions is also trickier.
Mukesh Kumar’s Post
More Relevant Posts
-
🔄 𝐔𝐩𝐜𝐨𝐦𝐢𝐧𝐠 𝐂𝐨𝐧𝐜𝐮𝐫𝐫𝐞𝐧𝐜𝐲 𝐂𝐥𝐮𝐛 𝐒𝐞𝐬𝐬𝐢𝐨𝐧 #3: Building a Blocking Queue Last 2 discussions were focussed on the fundamentals of concurrency, monitor locks, race conditions. Will be having the call on 8 Dec 10:00PM (sunday). For this session, we will "not be" following through a chapter from the book, it'll be a practical session where we'll be looking into implementing a blocking queue which is a key component in producer consumer applications. We'll be looking into: 1. Implementing thread-safe `offer()` and `poll()` operations 2. Condition variables and efficient thread signaling (vv imp) 3. Handling queue full/empty scenarios 4. Performance considerations and optimization techniques Previous session recap: https://lnkd.in/gz42-SGG Interested in joining? Fill out this form: https://lnkd.in/gURDvYYA
To view or add a comment, sign in
-
-
Common Merge Conflicts Caption: In high-concurrency environments, merges can conflict. Delta typically handles these gracefully, but you may see “concurrent modification” errors if transactions overlap. Question: How do you handle concurrency at scale?
To view or add a comment, sign in
-
𝗔𝗿𝗲 𝘆𝗼𝘂 𝗮𝘄𝗮𝗿𝗲 𝗼𝗳 𝘁𝗵𝗲 𝗹𝗶𝗺𝗶𝘁𝗮𝘁𝗶𝗼𝗻𝘀 𝗶𝗻 𝗣𝗼𝘄𝗲𝗿 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗲? Let's learn about a few of them today. 1)𝗡𝘂𝗺𝗯𝗲𝗿 𝗼𝗳 𝗮𝗰𝘁𝗶𝗼𝗻𝘀 𝗽𝗲𝗿 𝘄𝗼𝗿𝗸𝗳𝗹𝗼𝘄 -> 500 ( Flows with many actions may face performance issues during editing, even with fewer than 500 actions. To improve performance, consider using child flows to reduce the number of actions in a single flow or if your flow requires more than 500 actions. ) 2)𝗡𝘂𝗺𝗯𝗲𝗿 𝗼𝗳 𝗻𝗲𝘀𝘁𝗲𝗱 𝗮𝗰𝘁𝗶𝗼𝗻𝘀 𝗮𝗹𝗹𝗼𝘄𝗲𝗱 -> 8 3) 𝗦𝘄𝗶𝘁𝗰𝗵 𝗦𝗰𝗼𝗽𝗲 𝗰𝗮𝘀𝗲𝘀 𝗹𝗶𝗺𝗶𝘁 -> 25 4)𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲𝘀 𝗽𝗲𝗿 𝘄𝗼𝗿𝗸𝗳𝗹𝗼𝘄 -> 250 5)𝗡𝘂𝗺𝗯𝗲𝗿 𝗼𝗳 𝗳𝗹𝗼𝘄𝘀 𝗼𝘄𝗻𝗲𝗱 𝗯𝘆 𝗮 𝘀𝗶𝗻𝗴𝗹𝗲 𝘂𝘀𝗲𝗿 ->600 (Use flows under solutions if you need more than 600) 6)𝗥𝗲𝘁𝗿𝘆 𝗮𝘁𝘁𝗲𝗺𝗽𝘁𝘀 -> 90 7)𝗡𝘂𝗺𝗯𝗲𝗿 𝗼𝗳 𝗰𝘂𝘀𝘁𝗼𝗺 𝗰𝗼𝗻𝗻𝗲𝗰𝘁𝗼𝗿𝘀 -> 50 (Per user) 8)𝗡𝘂𝗺𝗯𝗲𝗿 𝗼𝗳 𝗿𝗲𝗾𝘂𝗲𝘀𝘁𝘀 𝗽𝗲𝗿 𝗺𝗶𝗻𝘂𝘁𝗲 𝗳𝗼𝗿 𝗮 𝗰𝘂𝘀𝘁𝗼𝗺 𝗰𝗼𝗻𝗻𝗲𝗰𝘁𝗼𝗿 -> 500 request per minute 9)𝗘𝘅𝗽𝗿𝗲𝘀𝘀𝗶𝗼𝗻 𝗲𝘃𝗮𝗹𝘂𝗮𝘁𝗶𝗼𝗻 𝗹𝗶𝗺𝗶𝘁 -> 131,072 characters ( Expressions like concat (), base64(), string() can't take longer than this) 10)𝗖𝗼𝗻𝗰𝘂𝗿𝗿𝗲𝗻𝘁 𝗿𝘂𝗻𝘀 -> Unlimited for flows with Concurrency Control turned off 1 to 100 when Concurrency Control is turned on (defaults to 25)
To view or add a comment, sign in
-
When you write smart contracts, your code moves money directly. This means that bugs can be incredibly expensive—millions of dollars are frequently lost due to protocol hacks. If you're going to deploy production-ready smart contracts, always have your code audited by experts. That said, a good first step is to have 100% testing coverage on your smart contracts. Pesto has 100% testing coverage! 🙂
To view or add a comment, sign in
-
Concurrency is very challenging. And the Dunning–Kruger effect quite common. Most programmers seem to expect some quick trick or tool will magically solve all their problems, like a silver bullet. Even pointing out their errors to them, face-to-face often has little effect, as their faith is so strong. We've had to implement scanners for mutable global (static) variables and Collections, as quite a few programmers seem to have any idea that this is a bad thing -- on a multi-user web server. Many expect that adding a "synchronized" wrapper to a Collection makes all uses thread safe -- without regard to how the code using the collection uses its methods.
Concurrency gets the best of me: https://lnkd.in/guTwjD24
To view or add a comment, sign in
-
If you are not completely familiar with EVM errors hierarchy, I highly recommend you to read this post. Maybe you will find something new. Errors are divided into the two types: evm-level errors and smart contract level errors (reverts, panics etc). Ethereum node handles them independendly, so every call could end with error or with revert. Errors deal with a few very critical situations like trying to change a state during static call, exceeding stack depth etc. Error halts execution of the current call and burns 63/64 of gas sent with the call. Error gives no information to the caller what's happen on the level of smart contract. That's is, if your call ends with an error, caller gets no RETURNDATA. The only way to understand what happened is to parse failing transaction by debug/trace. You could look for the full list of errors here: https://lnkd.in/drasbhwX Reverts are errors deliberately raised on the smart contract level. Revert does not consume additional gas. Revert could give its caller additional information through RETURNDATA. Reverts could be devided on Solidity-level reverts and custom reverts. Custom reverts is what you do when require(condition, "Revert reason"). They are abi-encoded with Error(revert reason). Revert reason is usually a string but could be any data. Solidity reverts are usually Panic. They handle Solidity-level errors like overflow/underflow, divide by zero etc. They are encoded as Panic(panic code). You could look for the full list of panic codes here: https://lnkd.in/dvzZ_UXd It seems that there are few different revert types, encoded in a different way. For example, trying to call non-existent contract function will raise such a revert, but I'm not sure about the full list.
To view or add a comment, sign in
-
Did you know that in Swift Concurrency we can know where code runs at compile time? The reason for this is that functions know where they'll run regardless of where you call them from unlike in GCD where functions run on the calling queue. Learn more: https://lnkd.in/eU_6YZnZ
To view or add a comment, sign in
-
When you need thread locking, you can use the lock statement. However, what would you use for handling async methods? 𝗟𝗼𝗰𝗸 𝘀𝘁𝗮𝘁𝗲𝗺𝗲𝗻𝘁𝘀 cannot contain await due to potential synchronization issues. One of the solutions is to use 𝗦𝗲𝗺𝗮𝗽𝗵𝗼𝗿𝗲𝗦𝗹𝗶𝗺. It’s a viable solution in such cases, providing efficient synchronization and supporting async operations. All you need to do: Adjust the max count value to effectively regulate the concurrency level. Setting a timeout is a good practice to avoid indefinite blocking. Ensure that you release the lock safely, even in the event of exceptions, using a try-finally block. Share your thoughts in the comments below.👇 If you find this content helpful, consider following me for more daily insights! Feel free to repost to share the knowledge. ♻
To view or add a comment, sign in
-
-
DeFi protocols need searchers to execute liquidations. The problem? Searchers take on integration costs and complexity for each protocol that they choose to integrate with. This causes significant friction. The solution: Express Relay aggregates valuable transaction opportunities of multiple DeFi protocols in one place. Searchers can compete for these opportunities without writing bespoke code for each protocol’s interface. Want to learn more? https://lnkd.in/dYJNpc4F
To view or add a comment, sign in
-
-
The Swift Runtime ABI, or Application Binary Interface, is the API contract, (or protocol definition), for the Swift Runtime. The pre-compiled binary for libswiftCore is dynamically linked to your Swift executable at launch, and the ABI contract defines exactly which runtime function can be found at which memory address. See my full deep-dive into the runtime and its ABI at https://lnkd.in/eBnfJS_M
To view or add a comment, sign in
-