Blog post: https://segmentfault.com/a/1190000017136059
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ================================================================================ | |
| Input graphql | |
| ================================================================================ | |
| mutation update_RangeTest( | |
| $rval: RangeOfFloat, | |
| $mval: [RangeOfFloat!], | |
| $rdate: RangeOfString, | |
| $mdate: [RangeOfString!] | |
| ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 8月 07 12:53:04 fantix-pc gnome-shell[25632]: Source ID 2332 was not found when attempting to remove it | |
| 8月 07 12:53:06 fantix-pc gnome-shell[25632]: Error connecting to the screencast service | |
| 8月 07 12:53:12 fantix-pc systemd[1]: systemd-hostnamed.service: Deactivated successfully. | |
| 8月 07 12:53:14 fantix-pc systemd[1]: systemd-localed.service: Deactivated successfully. | |
| 8月 07 12:53:20 fantix-pc dbus-daemon[25486]: [session uid=1000 pid=25486] Activating via systemd: service name='org.freedesktop.Flatpak' unit='flatpak-session-helper.service' requested by ':1.95' (uid=1000 pid=26646 comm="/usr/bin/flatpak run --branch=stable --arch=x86_64") | |
| 8月 07 12:53:20 fantix-pc systemd[936]: Starting flatpak session helper... | |
| 8月 07 12:53:20 fantix-pc systemd[936]: Started Application launched by gnome-shell. | |
| 8月 07 12:53:20 fantix-pc dbus-daemon[25486]: [session uid=1000 pid=25486] Successfully activated service 'org.freedesktop.Flatpak' | |
| 8月 07 12:53:20 fantix-pc systemd[936]: Started flatpak session helper. | |
| 8月 07 12:53:20 fanti |
I hereby claim:
- I am fantix on github.
- I am fantix (https://keybase.io/fantix) on keybase.
- I have a public key whose fingerprint is 86EE EC21 4D24 5137 446F 4AB1 9530 4B04 071C CDB4
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[macro_use] | |
| extern crate lazy_static; | |
| use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; | |
| use std::thread::sleep; | |
| use std::time::Duration; | |
| static READERS: u64 = 100; | |
| static WRITERS: u64 = 2; | |
| static RUNNING: AtomicBool = AtomicBool::new(true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import datetime | |
| import os | |
| import socket | |
| import ssl | |
| import threading | |
| import uuid | |
| from cryptography import x509 | |
| from cryptography.hazmat import backends | |
| from cryptography.hazmat.primitives import hashes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import functools | |
| import signal as signal_mod | |
| import warnings | |
| def _release_waiter(waiter, *args): | |
| if not waiter.done(): | |
| waiter.set_result(None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test_api_errors_01 (test_api_errors.TestErrorsClasses) | 0.0005875366666335443 | 3 | |
|---|---|---|---|
| test_api_errors_02 (test_api_errors.TestErrorsClasses) | 0.00033936866672471905 | 3 | |
| test_common_ast_copy (common.test_ast.ASTBaseTests) | 0.0005624686666199826 | 3 | |
| test_common_ast_match (common.test_ast.ASTMatchTests) | 0.002293278333316569 | 3 | |
| test_common_ast_type_anno (common.test_ast.ASTBaseTests) | 0.0014174716666654301 | 3 | |
| test_common_ast_typing (common.test_ast.ASTBaseTests) | 0.0043385533333548665 | 3 | |
| test_common_checked_checkeddict_basics (common.test_checked.CheckedDictTests) | 0.0013698453333290672 | 3 | |
| test_common_checked_checkeddict_pickling (common.test_checked.CheckedDictTests) | 0.0007251706666693281 | 3 | |
| test_common_checked_checkedlist_basics (common.test_checked.CheckedListTests) | 0.0006082380000028328 | 3 | |
| test_common_checked_checkedset_basics (common.test_checked.CheckedSetTests) | 0.0007858390000213452 | 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.1.1/normalize.min.css" rel="stylesheet" | |
| type="text/css"/> | |
| <script charset="utf-8" src="https://d3js.org/d3.v3.js"></script> | |
| <style> | |
| html { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This code demonstrates how FastAPI server freezes with SQLAlchemy under concurrency, | |
| if you're mixing blocking operations with async calls inproperly. | |
| (pip install sqlalchemy httpx fastapi uvicorn) | |
| You will see 15 (not 20!) "Handling xxx", then the server freezes for minutes, | |
| refusing to serve any request. | |
| This is caused by "resource starvation" - the default SQLAlchemy connection pool size |
NewerOlder