How Meta Made Debugging Async Code Easier with Coroutines and Senders
…_sr_thunk_task<…> …inject_stop_request_thunk<…>(…_sa_task) () at /home/cppcon/c 5 : auto unifex::connect_awaitable(task , receiver auto&) () at /home/cppcon/cppcon24-async 6 : unifex::task a decltype(auto) …_promise ::await_transform(…) () at /home/cppcon/cppcon24-async-demo/li 13: auto unifex::connect_awaitable(task , receiver auto&) () at /home/cppcon/cppcon24-async 14: main () at /home/cpp …inject_stop_request_thunk<…>(…_sa_task ) () at task.hpp:824 5 : auto unifex::connect_awaitable(task , receiver auto&) () at connect_awaitable.hpp:234 6 : unifex::task async_main<…>(span , auto& 0 码力 | 131 页 | 907.41 KB | 5 月前3websockets Documentation Release 9.0
asyncio import websockets async def hello(): uri = "ws://localhost:8765" async with websockets.connect(uri) as websocket: await websocket.send("Hello world!") await websocket.recv() asyncio.get_event_loop() asyncio import websockets async def hello(): uri = "ws://localhost:8765" async with websockets.connect(uri) as websocket: name = input("What's your name? ") await websocket.send(name) print(f"> {name}") websocket.recv() print(f"< {greeting}") asyncio.get_event_loop().run_until_complete(hello()) Using connect() as an asynchronous context manager ensures the connection is closed before exiting the hello coroutine0 码力 | 81 页 | 352.88 KB | 1 年前3Casdoor · An Open Source UI-first Identity Access Management (IAM) / Single-Sign-On (SSO) platform supporting OAuth 2.0, OIDC, SAML and CAS
Dashboard SSO sign-in (other languages: Chinese, Japanese) GitLab Vue + Ruby + Rails OpenID Connect OmniAuth provider Apache Shenyu Java Casdoor Plugin (other languages: Chinese) Alist TypeScript performing any operations associated with the same ID . Ho How t w to Connect t o Connect to Casdoor o Casdoor ? ? Ov Over erview view Connect your app to Casdoor ? ? Standar Standard OIDC Client d OIDC Client Authn hn Use WebAuthn in Casdoor Ov Over erview view In this section, we will show you how to connect your application to Casdoor. As a Service Provider (SP), Casdoor supports two authentication protocols:0 码力 | 825 页 | 58.31 MB | 1 年前3peewee Documentation Release 1.0.0
to explicitly connect to the database before using it, managing connections explicitly is a good practice. This way if the connection fails, the exception can be caught during the “connect” step, rather arbitrary time later when a query is executed. >>> database = SqliteDatabase('stats.db') >>> database.connect() To use this database with your models, specify it in an inner “Meta” class: class MyModel(Model): = peewee.CharField() ... ... class Meta: ... database = custom_db ... >>> custom_db.connect() >>> CustomModel.create_table() Best practice: define a base model class that points at the database0 码力 | 101 页 | 163.20 KB | 1 年前3peewee Documentation Release 1.0.0
to explicitly connect to the database before using it, managing connections explicitly is a good practice. This way if the connection fails, the exception can be caught during the “connect” step, rather arbitrary time later when a query is executed. >>> database = SqliteDatabase(’stats.db’) >>> database.connect() To use this database with your models, specify it in an inner “Meta” class: class MyModel(Model): whatev = peewee.CharField() ... ... class Meta: ... database = custom_db ... >>> custom_db.connect() >>> CustomModel.create_table() Best practice: define a base model class that points at the database0 码力 | 71 页 | 405.29 KB | 1 年前3peewee Documentation Release 2.10.2
database = db # this model uses the "people.db" database Now that we have our models, let’s connect to the database. Although it’s not necessary to open the connection explicitly, it is good practice connection when it receives a request, and close the connection when it sends the response. >>> db.connect() We’ll begin by creating the tables in the database that will store our data. This will create interpreter. We can create a small helper function to accomplish this: def create_tables(): database.connect() database.create_tables([User, Relationship, Message]) Open a python shell in the directory0 码力 | 275 页 | 276.96 KB | 1 年前3peewee Documentation Release 2.0.2
to explicitly connect to the database before using it, managing connections explicitly is a good practice. This way if the connection fails, the exception can be caught during the “connect” step, rather arbitrary time later when a query is executed. >>> database = SqliteDatabase(’stats.db’) >>> database.connect() To use this database with your models, specify it in an inner “Meta” class: class MyModel(Model): CustomModel(Model): ... whatev = CharField() ... ... class Meta: ... database = custom_db ... >>> custom_db.connect() >>> CustomModel.create_table() Best practice: define a base model class that points at the database0 码力 | 65 页 | 315.33 KB | 1 年前3peewee Documentation Release 2.10.2
Meta: database = db # this model uses the "people.db" database Now that we have our models, let’s connect to the database. Although it’s not necessary to open the connection explicitly, it is good practice connection when it receives a request, and close the connection when it sends the response. >>> db.connect() We’ll begin by creating the tables in the database that will store our data. This will create interpreter. We can create a small helper function to accomplish this: def create_tables(): database.connect() database.create_tables([User, Relationship, Message]) Open a python shell in the directory alongside0 码力 | 221 页 | 844.06 KB | 1 年前3peewee Documentation Release 3.0.0
database = db # this model uses the "people.db" database Now that we have our models, let’s connect to the database. Although it’s not necessary to open the connection explicitly, it is good practice connection when it receives a request, and close the connection when it sends the response. db.connect() We’ll begin by creating the tables in the database that will store our data. This will create instance, if you are using a connection pool, connections will only be recycled correctly if you call connect() and close(). We will tell flask that during the request/response cycle we need to create a connection0 码力 | 319 页 | 361.50 KB | 1 年前3websockets Documentation Release 5.0
/usr/bin/env python import asyncio import websockets async def hello(uri): async with websockets.connect(uri) as websocket: await websocket.send("Hello world!") asyncio.get_event_loop().run_until_complete( # WS client example import asyncio import websockets async def hello(): async with websockets.connect( 'ws://localhost:8765') as websocket: name = input("What's your name? ") await websocket.send(name) websocket.recv() print(f"< {greeting}") asyncio.get_event_loop().run_until_complete(hello()) Using connect() as an asynchronous context manager ensures the connection is closed before exiting the hello coroutine0 码力 | 56 页 | 245.43 KB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100