Can std::future cause coredump without get or wait

Advertisements void func() { std::future<int> fut = std::async(std::launch::async, []{ std::this_thread::sleep_for(std::chrono::seconds(10)); return 8; }); return; } Let’s say that I have such a function. An object fut of std::future<int> is initialized with a std::async job, which will return an integer in the future. But the fut will be immediately released after the function func returns. Is… Read More Can std::future cause coredump without get or wait

Unable to read/write to file from Lua script running from HAPRoxy

Advertisements I was using Lua with HAProxy to write logs into custom log file. Although my script is running totally fine. But I don’t see anything written in my text file. Here is my lua script which I am loading from HAProxy.cfg. local function foo(value) — MY CODE — file = io.open("test.lua", "a") io.output(file) io.write("The… Read More Unable to read/write to file from Lua script running from HAPRoxy

Does running a synchronous method using Task.Run() make it asynchronous

Advertisements Let’s consider a class (This is not the class or code I’m using in my application, just trying to learn with this example) class Person { public int Id {get; set;} public string Name {get; set;} public int DeptId {get; set;} public string Department {get; set;} } Now let’s assume I get a List… Read More Does running a synchronous method using Task.Run() make it asynchronous

How to remove Sonar issue on Java stream "Refactor the code so this stream pipeline is used"

Advertisements I’m working on a project (Java 17) where I have a list of object with two properties, actionId (String) and right (boolean). I’m trying to get the actionId for object with right = true and store the result as List of String. This is my code: List<String> usserValidActionsArray = userActionGatewayDTO.stream().filter(UserActionGatewayDTO::getRight) .map(UserActionGatewayDTO::getActionId).toList(); My code works… Read More How to remove Sonar issue on Java stream "Refactor the code so this stream pipeline is used"