Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungKI half beim Finden: iOS 27 schließt mehr als 100 Sicherheitslücken(21.09.2026 um 06:00 Uhr)
Sichere ProgrammierungWhat Is Rowhammer? How Can Repeated Memory Access Flip Bits in RAM?(21.09.2026 um 07:12 Uhr)
Sichere Programmierungnpm publish Ignores .gitignore: The .npmignore Override Rule(21.09.2026 um 07:15 Uhr)
Sichere ProgrammierungAphelion Editor - A free node-based video / VFX editor(21.09.2026 um 07:21 Uhr)
Sichere ProgrammierungGovernance Attack Surface Review: OKX(21.09.2026 um 07:31 Uhr)
Sichere ProgrammierungJSM Portal Request Create Property Panel Submit(21.09.2026 um 07:34 Uhr)
Reverse Engineeringsearch instructions assembly easy (X86,RISCV,AARCH64,etc)(20.09.2026 um 15:44 Uhr)
Sichere ProgrammierungKI half beim Finden: iOS 27 schließt mehr als 100 Sicherheitslücken(21.09.2026 um 06:00 Uhr)
Sichere ProgrammierungWhat Is Rowhammer? How Can Repeated Memory Access Flip Bits in RAM?(21.09.2026 um 07:12 Uhr)
Sichere Programmierungnpm publish Ignores .gitignore: The .npmignore Override Rule(21.09.2026 um 07:15 Uhr)
Sichere ProgrammierungAphelion Editor - A free node-based video / VFX editor(21.09.2026 um 07:21 Uhr)
Sichere ProgrammierungGovernance Attack Surface Review: OKX(21.09.2026 um 07:31 Uhr)
Sichere ProgrammierungJSM Portal Request Create Property Panel Submit(21.09.2026 um 07:34 Uhr)
Reverse Engineeringsearch instructions assembly easy (X86,RISCV,AARCH64,etc)(20.09.2026 um 15:44 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Stop Waiting Around: Async & Await in Python Explained

Reagiere als Erste:r — dein Feedback zählt!

Hey JavaScript… Python’s got async too!

So what exactly is async, and why should you care about it in Python?

Since Python has become the go-to language for AI, data, and backend services, understanding asynchronous programming is more important than ever. If you’re making calls to LLMs, APIs, or any external service, async gives you a powerful way to manage those operations without your program sitting idle and wasting time.

What Async Actually Is

Think of async as lightweight concurrency. It’s similar to threading or multiprocessing, but much simpler to write and more efficient in many cases.

When you define a function with:

async def my_function():
    ...

you’re not just making a normal function. Technically, you’re creating a coroutine — a special kind of function that can be paused and resumed.

What Happens When You Call a Coroutine?

Here’s the gotcha: if you just call it, you don’t actually run it. You get back a coroutine object. To execute it, you need the await keyword:

result = await my_function()

That await tells Python: “Pause here until the coroutine is done, then give me the result.”

So while the word “async” sounds non-blocking, the await line itself is blocking for that specific call.

Enter the Event Loop

The real magic comes from Python’s built-in event loop (provided by asyncio). The event loop is like a conductor for your coroutines. While one coroutine is waiting — say, for an API call — the loop can run another one in the meantime.

This gives you concurrency without the complexity of threads.

Running Multiple Coroutines

One of the coolest features is asyncio.gather(). With it, you can schedule multiple coroutines to run “at once” (really, managed by the event loop):

import asyncio

async def first_run():
    await asyncio.sleep(1)
    return "First done"

async def second_run():
    await asyncio.sleep(2)
    return "Second done"

async def third_run():
    await asyncio.sleep(1)
    return "Third done"

async def main():
    output = await asyncio.gather(
        first_run(),
        second_run(),
        third_run()
    )
    print(output)

asyncio.run(main())


Output:

['First done', 'Second done', 'Third done']

Even though second_run() takes longer, the others don’t wait around — the event loop keeps everything moving efficiently.

Takeaway

async and await give Python developers an elegant way to write concurrent code. Whether you’re working with LLMs, APIs, or just want your app to be more responsive, it’s a tool worth learning.

So next time someone drops “coroutine” in your Slack thread, you’ll know what’s up. 😉

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Stop Waiting Around: Async & Await in Python Explained

Thematisch verwandte Begriffe: Stop, Waiting, Around, Async · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94109 | openEQUELLA versions before 2026.1.0 contain a remote code execution vul…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick