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

Резултати

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

Пребарај: #snapchat

当前筛选 #snapchat清除筛选
🦅 [ perspective ix ]

@perspectiveix · Post #1641 · 06.11.2018 г., 10:00

💸SnapAds are the Primary Ad Spend on Snapchat #Snapchat advertising spend by national marketers was projected to have increased by 10% in Q3 and by 8% through the first 9 months of the year, according to recent figures from Standard Media Index, which sources its data directly from the invoices of 5 of the 7 major media holding companies and leading independent agencies. Snapchat’s advertising business has been growing slower than expected. Well, at least according to eMarketer, which recently drastically cut its forecast for the platform’s ad revenues. 🚀@PerspectiveIX via MarketingCharts. 👻 Join us on Snapchat! ❓Do you use Snapchat?

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1521 · 05.09.2018 г., 08:00

​​👻Snap Across the Map According to Snap, on average, 188 million people around the world use #Snapchat on a daily basis, and these daily active Snapchatters use the app at an average of over 20 times per day. As of August 2018, these are the number of users Snapchat can reach in different regions/countries: - 93 million in the 🇺🇸 & 🇨🇦 - 76 million in Europe (17.5m in 🇫🇷, 15.5m in 🇬🇧, 9.2m in 🇩🇪) - 21 million in MENA (13.1m in 🇸🇦, 2.6m in 🇮🇶, 1.8m in 🇦🇪) - 13 million in Latin America - 6.5 million in 🇮🇳 - 6 million in 🇦🇺 🚀@PerspectiveIX via Snap. ❓Do you use Snapchat?

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1506 · 29.08.2018 г., 08:00

​​👻Snapchat's Growth In their Q2 2018 earnings report, Snap, #Snapchat's parent company, reported beating revenue expectations by 5%, but user growth, after slowing considerably for two years, went in the opposite direction. Snap’s Daily Active Users were (DAUs) still up 9% YoY, but for the first time declined sequentially by 2%. 🚀@PerspectiveIX Read more about Snap's growth excuses at Stratechery.

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1444 · 07.08.2018 г., 18:30

​​👻Has Snapchat already stopped growing? Snap reports its Q2 results today after the market close. And the consensus from analysts is that Snap’s audience will grow by just 1 million daily active users, according to FactSet. That’s surprising, considering that #Snapchat added 21 million new users in the same period two years ago. 🚀@PerspectiveIX 📖 via Recode: prs.pctvix.co/2Mqa5mZ

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1291 · 23.05.2018 г., 19:30

👻Want More Followers on Snapchat? Getting discovered on #Snapchat is not the easiest thing, so we thought we share what we’ve learned so far: https://prs.pctvix.co/2IdOu23 🚀@PerspectiveIX

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1210 · 18.04.2018 г., 23:05

​​🤠For Snapchat Fans Out There We're making a few #Snapchat Lenses (aka face filters). Already made these caps: ❤️ Manchester United: https://prs.pctvix.co/2qF9yDY 💚 New York Jets: https://prs.pctvix.co/2HaW5uD 🦄 Unicorn: https://prs.pctvix.co/2F01RgC If you want a cap for the team you support, message @iXContactBot with the NAME, COUNTRY, and SPORT your team plays. We will randomly select 3 of them and make you a cap! You have 24 hours. Good luck 🙂 🚀@PerspectiveIX 👻 Add us on Snapchat: http://prs.pctvix.co/SnapchatIX

Hashtags

🦅 [ perspective ix ]

@perspectiveix · Post #1144 · 11.03.2018 г., 20:30

👻#Snapchat users are young, American, and Snap a lot! 🚀@PerspectiveIX 👻 Add us on Snapchat: http://prs.pctvix.co/SnapchatIX Do you you use Snapchat? 👍🏻 Yes 👎🏻 No

Hashtags

123•••78
ПретходнаСтраница 1 од 8Следна