Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
import threading | |
''' | |
A generic iterator and generator that takes any iterator and wrap it to make it thread safe. | |
This method was introducted by Anand Chitipothu in http://anandology.com/blog/using-iterators-and-generators/ | |
but was not compatible with python 3. This modified version is now compatible and works both in python 2.8 and 3.0 | |
''' | |
class threadsafe_iter: | |
"""Takes an iterator/generator and makes it thread-safe by | |
serializing call to the `next` method of given iterator/generator. | |
""" |
<!DOCTYPE html> | |
<html> | |
<body> | |
<br> | |
<h2>Thank you for your order {{ order.full_name }}</h2> | |
<h3>Your Order ID: {{ order.short_uuid }}</h3> | |
<h3>Shipping Details:</h3> |
Using iterators and generators in multi-threaded applications | |
24 May 2012 – Bangalore | |
Python iterators and generators have almost the same behavior, but there are subtle differences, especially when the iterator/generator is used in a multi-threaded application. | |
Here is an example to demonstrate that behavior. | |
import threading | |
def count(): |