Birmingham-mumbai



tải về 6.62 Mb.
Chế độ xem pdf
trang5/275
Chuyển đổi dữ liệu09.10.2023
Kích6.62 Mb.
#55278
1   2   3   4   5   6   7   8   9   ...   275
Sherwin John Tragura - Building Python Microservices with FastAPI Build secure, scalable, and structured Python microservices from design concepts to infrastructure-Packt Publishing - ebooks Account

254
Designing asynchronous
transactions 258
Using the HTTP/2 protocol 
261
Creating asynchronous
background tasks 
261
Using the coroutines 
261
Creating multiple tasks 
263
Understanding Celery
tasks 263
Creating and configuring the
Celery instance 
264
Creating the task 
266
Calling the task 
267
Starting the worker server 
267
Monitoring the tasks 
268
Building message-driven
transactions using
RabbitMQ 269
Creating the Celery instance 
269
Monitoring AMQP messaging 
269
Building publish/subscribe 
messaging using Kafka 
270
Running the Kafka broker and server 
271
Creating the topic 
271
Implementing the publisher 
271
Running a consumer on a console 
272
Implementing asynchronous
Server-Sent Events (SSE) 
273
Building an asynchronous
WebSocket 275
Implementing the asynchronous
WebSocket endpoint 
275
Implementing the WebSocket
client 276
Applying reactive
programming in tasks 
277
Creating the Observable data
using coroutines 
278
Creating background process 
280
Accessing API resources 
281
Customizing events 
283
Defining the startup event 
283
Defining shutdown events 
284
Summary 284


Table of Contents 
xiii
Part 3: Infrastructure-Related Issues, Numerical 
and Symbolic Computations, and Testing 
Microservices
9
Utilizing Other Advanced Features 
287
Technical requirements 
288
Applying session
management 288
Creating user sessions 
288
Managing session data 
291
Removing the sessions 
292
Customizing BaseHTTPMiddleware 
293
Managing the CORS
mechanism 295
Customizing APIRoute and
Request 297
Managing body, form, or JSON data 
297
Encrypting and decrypting the
message body 
300
Choosing the appropriate
responses 302
Setting up the Jinja2 template
engine 307
Setting up the static resources 
307
Creating the template layout 
308
Using ORJSONResponse and
UJSONResponse 310
Applying the OpenAPI 3.x 
specification 311
Extending the OpenAPI schema
definition 311
Using the internal code base
properties 314
Using the Query, Form, Body,
and Path functions 
316
Testing the API endpoints 
320
Writing the unit test cases 
321
Mocking the dependencies 
321
Running test methods 
323
Summary 324
10
Solving Numerical, Symbolic, and Graphical Problems 
325
Technical requirements 
326
Setting up the projects 
326
Using the Piccolo ORM
326
The Beanie ODM 
331
Implementing symbolic
computations 331
Creating symbolic expressions 
331
Solving linear expressions 
332


Table of Contents
xiv
Solving non-linear expressions 
333
Solving linear and non-linear
inequalities 333
Creating arrays and
DataFrames 334
Applying NumPy’s linear system
operations 335
Applying the pandas module 
336
Performing statistical
analysis 337
Generating CSV and XLSX
reports 338
Plotting data models 
342
Simulating a BPMN
workflow 346
Designing the BPMN workflow 
346
Implementing the workflow 
348
Using GraphQL queries
and mutations 
350
Setting up the GraphQL platform 
350
Creating the record insertion,
update, and deletion 
350
Implementing the query
transactions 353
Running the CRUD transactions 
353
Utilizing the Neo4j graph
database 355
Setting the Neo4j database 
356
Creating the CRUD transactions 
356
Summary 360
11
Adding Other Microservice Features 
361
Technical requirements 
362
Setting up the virtual
environment 362
Checking the API
properties 364
Implementing open tracing 
mechanisms 365
Setting up service registry
and client-side service
discovery 369
Implementing client-side service
discovery 370
Setting up the Netflix Eureka
service registry 
371
Deploying and running
applications using Docker 
372
Generating the requirements.txt file 
372
Creating the Docker image
373
Using the Mongo Docker image 
374
Creating the containers 
374
Using Docker Compose for 
deployment 375
Using NGINX as an API
Gateway 376
Integrating Flask and
Django sub-applications 
377
Summary 380


Table of Contents 
xv
Index 381
Other Books You May Enjoy 
394



Preface
This book teaches you about the components of the FastAPI framework and how to apply these 
components with some third-party tools to build microservices applications. You will need a background 
in Python programming, knowledge of the principles of API development, and an understanding 
of the principles behind creating an enterprise-grade microservice application. This is more than a 
reference book: it provides some code blueprints that will help you solve real-world applications while 
elaborating on and demonstrating the topics of each chapter.
Who this book is for
This book is for Python web developers, advanced Python users, and backend developers using Flask 
or Django who want to learn how to use the FastAPI framework to implement microservices. Readers 
knowledgeable about REST API and microservices will also benefit from this book. Some parts of the 
book contain general concepts, processes, and instructions that intermediate-level developers and 
Python enthusiasts can relate to as well.

tải về 6.62 Mb.

Chia sẻ với bạn bè của bạn:
1   2   3   4   5   6   7   8   9   ...   275




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương