function ag_enam_fetch_parallel($date, $commodities) { $multi = curl_multi_init(); $channels = []; $max_parallel = 5; // ⚠️ IMPORTANT (do NOT increase too much) $chunks = array_chunk($commodities, $max_parallel, true); $results = []; foreach ($chunks as $chunk) { $channels = []; foreach ($chunk as $id => $name) { $payload = json_encode([ "date" => $date, "liveDate" => $date, "commodityIds" => [$id] ]); $ch = curl_init("https://api.agmarknet.gov.in/v1/prices-and-arrivals/commodity-market/daily-report-weighted"); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload, CURLOPT_HTTPHEADER => [ "Content-Type: application/json", "User-Agent: Mozilla/5.0" ], CURLOPT_TIMEOUT => 20, // ✅ HARD timeout CURLOPT_CONNECTTIMEOUT => 10, // ✅ connection timeout ]); curl_multi_add_handle($multi, $ch); $channels[$id] = $ch; } do { $status = curl_multi_exec($multi, $running); curl_multi_select($multi); // ✅ VERY IMPORTANT (prevents CPU hang) } while ($running && $status == CURLM_OK); foreach ($channels as $id => $ch) { $content = curl_multi_getcontent($ch); if ($content) { $results[$id] = json_decode($content, true); } else { $results[$id] = null; // failed safely } curl_multi_remove_handle($multi, $ch); } // ⚡ small delay → avoid API block usleep(300000); // 0.3 sec } curl_multi_close($multi); return $results; } September 26, 2019 – Soybean prices increased | Soybean prices on Wednesday increased by Rs 46 to Rs 3,891 per quintal in the futures trade as speculators raised their positions supported by a strong spot demand. Marketmen said fresh positions created by participants pushed up soybean prices. On the National Commodity and Derivatives Exchange, soybean contracts for October delivery traded higher by Rs

- Advertisement -

Soybean prices increased

Soybean prices on Wednesday increased by Rs 46 to Rs 3,891 per quintal in the futures trade as speculators raised their positions supported by a strong spot demand.

Marketmen said fresh positions created by participants pushed up soybean prices.

On the National Commodity and Derivatives Exchange, soybean contracts for October delivery traded higher by Rs 46, or 1.2 per cent, to Rs 3,891 per quintal in an open interest of 46,690 lots.

- Advertisement -