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

Резултати

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

Пребарај: #addiction

当前筛选 #addiction清除筛选
蛋挞报

@Pincongessence · Post #2491 · 04.11.2021 г., 03:12

当我们过度沉迷游戏或社交媒体以致无法按时完成某项工作,或是想要学习某项新技能却总是在实践阶段动力不足时,不妨先放下“缺乏自控力”或是“意志力不够强”这类自我批评。从生理学和行为学的角度了解成瘾的机制,可以帮助我们以更清醒的方式规划生活,朝着既定的目标前进。 Dopamine Detox:How I Tricked My Brain To Like Doing Hard Things #video#dopamine#addiction#detox

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40622 · 03.02.2026 г., 15:02

Some studies found that watching a lot of (internet)pornography can change the brain. Brain scans showed stronger links in areas that control emotions and decisions. People who watch often feel more pleasure but have less self-control. After watching, their thinking and attention get worse. Their facial expressions also show less emotion, like surprise or disgust, even if they say they enjoyed it. These changes are similar to drug addiction. Repeating this behavior can make emotional responses dull and reduce mental sharpness. More research is needed, but finding people who never watched porn for studies is very difficult to impossible.. 🧠📉 [Read more1] [Read more2] [Read more3] [How to stop watching] @googlefactss #BrainHealth#Addiction#Pornography#porn#MentalHealth#Neuroscience 👮‍♂🚫Warning: Even though this post and the following poll are sexual in nature. Rules still apply. Be respectful or face the consequences..

American Оbserver

@american_observer · Post #5474 · 26.03.2026 г., 01:59

Meta, YouTube and the First Cracks in Big Tech’s Legal Armor Meta and YouTube just lost the “we’re just a platform” myth in court. A jury looked at their design tricks and called them what they are: engineered addiction for kids. In Los Angeles, jurors found Meta and YouTube negligent and awarded $3 million to a young woman, K.G.M., who said she was pulled into Instagram and YouTube as a child and ended up with anxiety and depression. Her lawyers didn’t argue about a bad post or a rogue comment; they went after the architecture — endless scroll, engagement loops, notification hooks — as a product defect, not a speech issue. The verdict landed 24 hours after a New Mexico jury ordered Meta to pay $375 million in civil penalties for deceiving parents and endangering children, finding the company put profits over safety and misled the public about harms. Two juries, two states, same message: Section 230 won’t save you if the claim is “you built an addiction machine,” not “someone posted something nasty.” And this is only the opening salvo. There are more than 2,400 similar cases pending in federal litigation against Meta, Google, TikTok and Snap, brought by teens, parents, school districts and attorneys general all arguing the same core point: the harm is in the design, not just the content. Silicon Valley thought it had legal armor; what it actually has is a growing line of juries ready to test how much that armor is really worth. #meta#youtube#socialmedia#addiction#lawsuits#kids#bigtech 📱American Оbserver - Stay up to date on all important events 🇺🇸

TikTok CEO Shou Chew on Its Future — and What Makes Its Algorithm Different | Live at TED2023 @TED TikTok CEO Shou Chew dives into how the trend-setting video app and cultural phenomenon works — from what distinguishes its algorithm and drives virality to the challenges of content moderation and digital addiction. In a wide-ranging conversation with head of TED Chris Anderson, he tells stories about the TikTok creators he loves and digs into thorny issues like data privacy and government manipulation — as well as speaking personally about his commitment to inspiring creativity and building community. #YouTube#liked#TEDTalk#TEDTalks#TED_Talk#TED_Talks#TED#TikTok#Shou_Chew#culture#technology#business#entreprenuer#entertainment#media#software#innovation#communication#product_design#AI#social_media#Internet#governement#data#addiction#machine_learning#UX_design#online_privacy