C# Language Specification



Download 0,75 Mb.
bet237/524
Sana06.01.2022
Hajmi0,75 Mb.
#324842
1   ...   233   234   235   236   237   238   239   240   ...   524
Bog'liq
CSharp Language Specification

Await expressions


The await operator is used to suspend evaluation of the enclosing async function until the asynchronous operation represented by the operand has completed.

await-expression:
await unary-expression

An await-expression is only allowed in the body of an async function (§Error: Reference source not found). Within the nearest enclosing async function, an await-expression may not occur in these places:



  • Inside a nested (non-async) anonymous function

  • In a catch or finally block of a try-statement

  • Inside the block of a lock-statement

  • In an unsafe context

Note that an await-expression cannot occur in most places within a query-expression, because those are syntactically transformed to use non-async lambda expressions.

Inside of an async function, await cannot be used as an identifier. There is therefore no syntactic ambiguity between await-expressions and various expressions involving identifiers. Outside of async functions, await acts as a normal identifier.

The operand of an await-expression is called the task. It represents an asynchronous operation that may or may not be complete at the time the await-expression is evaluated. The purpose of the await operator is to suspend execution of the enclosing async function until the awaited task is complete, and then obtain its outcome.


        1. Download 0,75 Mb.

          Do'stlaringiz bilan baham:
1   ...   233   234   235   236   237   238   239   240   ...   524




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish