TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #425 · 20 апр.

Недавно делал быстрый прототип асинхронного приложения в котором требовалось вызывать много синхронного кода. Да, я знаю, что это не лучший дизайн, но нужно было быстрое решение на один процесс и без очередей. Поэтому я выполнял код в потоках. Выглядело это примерно так: from fastapi.concurrency import run_in_threadpool async def execute(data: DataRequest) -> DataResponse: try: result = await run_in_threadpool(sync_function, data) return DataResponse(data=result) except Exception as e: return DataResponse( error=str(e), success=False, ) В общем работает нормально. Для всех вызовов под капотом используется общий тредпул, всё работает предсказуемо. Но потребовалось изменить количество запускаемых в пуле потоков (по умолчанию создается 40 воркеров). Так как дело происходит с FastAPI, делается это через lifespan используя настройки anyio: import anyio @asynccontextmanager async def lifespan(app: FastAPI): limiter = anyio.to_thread.current_default_thread_limiter() limiter.total_tokens = 100 yield # если вдруг нужно вернуть обратно limiter.total_tokens = 40 Зачем менять количество воркеров? - уменьшить, если оперативки мало (один тред занимает ~8мб) - увеличить чтобы выдержать нагрузку Если есть предложения получше при тех же вводных - предлагайте😉 #async

Hashtags

Резултати

Пронајдени 3 слични објави

Пребарај: #tonfoundation

当前筛选 #tonfoundation清除筛选
TON Crypto News

@toncoin_rap · Post #151 · 17.09.2024 г., 19:31

🎧⤴ TON Foundation Collaborates with Curve Finance to Incubate Stable Swap Project The TON Foundation has teamed up with Curve Finance to incubate a TON-based stablecoin swap project, aiming to revolutionize stablecoin trading on the TON blockchain. With the demand for stablecoins on TON rapidly growing, and USDt reaching $729.9 million in circulation, this initiative will improve liquidity and enhance the Web3 ecosystem. By leveraging Curve’s CFMM technology, the collaboration seeks to streamline stablecoin swaps and minimize price impacts. With Michael Egorov advising, the selected independent team is set to innovate. Chorus: We’re buildin’ up the TON, it’s the next step on, With Curve at our back, we’re never gone. Stablecoins swap, yeah, the flow’s so strong, In the blockchain game, we gon’ last long. Verse 1: TON's the name, we rise, no fear, Curve in the mix, DeFi pioneers. Stablecoin swaps, make it clear, Liquidity’s high, the future’s near. CFMM tech, smooth like silk, Price impact low, no need for guilt. USDt growin’, millions in sight, We’re buildin’ the future, shine so bright. Chorus: We’re buildin’ up the TON, it’s the next step on, With Curve at our back, we’re never gone. Stablecoins swap, yeah, the flow’s so strong, In the blockchain game, we gon’ last long. Verse 2: From Telegram roots, we took the chance, Sharding the blocks, a future dance. Transactions fast, like a lightning glance, In the Web3 world, we enhance. Michael’s guidance, we push the plan, TON’s the network, we take a stand. Curve’s design, it’s the DeFi brand, Together we rise, hand in hand. Chorus: We’re buildin’ up the TON, it’s the next step on, With Curve at our back, we’re never gone. Stablecoins swap, yeah, the flow’s so strong, In the blockchain game, we gon’ last long. Verse 3: Apply today, join the crew, The future’s here, and it’s made by you. Swappin’ coins with a vision so true, Decentralized world, we break through. Millions waitin’, it’s time to act, With TON and Curve, there’s no turnin’ back. Liquidity surgin’, that’s a fact, The TON foundation is on track. Chorus: We’re buildin’ up the TON, it’s the next step on, With Curve at our back, we’re never gone. Stablecoins swap, yeah, the flow’s so strong, In the blockchain game, we gon’ last long. Bridge: Innovation’s key, we’re set to soar, With TON and Curve, there’s so much more. Stablecoins movin’, open the door, To a DeFi future we can’t ignore. #TONFoundation #Curve #TONCryptoNewsRapStyle

We start the year with another event — SE Telegram Builders Day in Hong Kong from @epicweb3!🪭 The day before Consensus HK starts, speakers from #Blum, #TerminalStation, #AnimocaBrands, #StormTrade, #Fintopio, #TONFoundation and other projects will gather on one stage. Participants will discuss the latest trends, attracting users and investments, secrets of viral projects, the future of the ecosystem and much more that awaits us in 2025. The event is FREE, but places are limited, so hurry if you want to join. 🗓️February 17, Hong Kong 🎫Get a free ticket👈

The Future of Toncoin One of the popular channels published a post under which users were asked to answer the question "What is missing in 🤑 TON?" For your convenience, all ideas are grouped into categories and repetitions are removed. ⚡️Infrastructure and technical improvements 🔵 Improving transaction speed and network performance (relevant for swaps, DEX and bridges), in real conditions under heavy load and not just on a test bench. 🔵 Official bridge to other blockchains (Ethereum, BSC, Solana, L2 Ethereum, etc.). 🔵 Optimization of oracles in bridges (so that transfers do not take from 7 hours to 12 days). 🔵 Launch of the official mempad by the TON Foundation. *TON Memelandia was launched last year, did not have much impact on TON. 🔵 Improving MEV bot algorithms, including mechanisms for returning part of the funds to users. 🔵 Introduction of limit orders on DEX and aggregators. 🔵 Improving support for existing projects and infrastructure. 🔵 Optimization of smart contracts to protect users (auto-vesting, prohibition of instant withdrawal of liquidity, etc.). 🔵 Developing a visual designer for dApps and mini-applications in TON (simplifying entry for new developers). 🔵 Optimization of Telegram Wallet and improvement of TON integration into #Telegram. 🔵 Reduced transaction fees. ⚡️DeFi Development 🔵 More liquidity in the $TON ecosystem. 🔵 Access to major tokens ($ETH, $BTC, $SOL) on #DEX. 🔵 Liquidity pools with the ability to use three or more tokens. 🔵 Simplifying the #P2P marketplace and improving user instructions. 🔵 Introduction of TON Pay and TON Business for convenient payments within the ecosystem. ⚡️Anti-fraud and transparency 🔵 Creation of a department to combat fraud within TON. 🔵 Checking token creators before launch (registration, reputation ratings). 🔵 A mechanism for quickly blocking scam channels and projects in Telegram. 🔵 Improving the transparency of the #TONFoundation and Telegram Mini Apps (disclosure of commands, #AMA sessions, public reports). 🔵 Introduction of risk insurance and user protection when investing in TON. ⚡️Marketing and expansion 🔵 Scaling TON beyond the CIS (China, USA, Europe, Latin America). 🔵 Creation of official TON accounts on Weibo and other social networks for the Chinese audience. 🔵 Implementation of TON in large services. 🔵 Active work with bloggers and media to attract new users. 🔵 Improving educational programs and guides on TON. 🔵 Conducting large partnerships (for example, with Telegram Premium, marketplaces and gaming platforms). ⚡️DAO, NFT and new mechanics 🔵 NFT marketplace with real digital assets (music, files, tokenization). 🔵 Gaming projects on TON with real monetization. 🔵 Tools for creating DAOs and custom #NFTs. 🔵 Integration of #Web3 authorization via Telegram. 🔵 Creating SocialFi initiatives and user reward mechanisms. 🔵 Launch of a #DeFi center inside TON (built-in swaps, staking, farming, #DAO). ⚡️General ideas 🔵 Selling concert tickets in #NFT format with gamification (VIP upgrades, voting for tracks, digital rewards). * this idea is already being implemented by at least 2 projects, well-known editors. 🔵 SBT reward payouts and ecosystem activity. 🔵 Launch of a "kickstarter" to finance new projects in #TONwith the support of the community. 🔵 Creating internal tokens with real utility, not just speculative instruments. 🔵 Introducing an additional token burning mechanism for economic sustainability. 🔄To summarize, most of the participants in the discussion believe that TON needs: 👍Improving technical infrastructure (bridges, speed, liquidity, DEX, DeFi). 👍Improving security and combating scams (anti-fraud department, project verification). 👍Global expansion (China, USA, Europe, partnerships). 👍Marketing initiatives (media, bloggers, educational programs). 👍Development of new products (DAO, NFT, SocialFi, Web3). 👍Transparency and openness of the TON Foundation. Despite the current difficulties, TON has the potential for explosive growth🤟, if it focuses on DeFi, mass adoption and game mechanics. ⚡️Boost | 🎞YouTube | 𝕏 Twitter