(20260623) Migrate to new server.
This commit is contained in:
+3
-2
@@ -41,7 +41,7 @@ import os
|
|||||||
# Utils:
|
# Utils:
|
||||||
from utils_v2.string import json
|
from utils_v2.string import json
|
||||||
from utils_v2.date_time import date_time
|
from utils_v2.date_time import date_time
|
||||||
from utils_v2.queue.async_kafka import ProducerKafka, ConsumerKafka, get_ssl_context
|
from utils_v2.queue.kafka.controllers.async_kafka import ProducerKafka, ConsumerKafka, get_ssl_context
|
||||||
|
|
||||||
# For async activities:
|
# For async activities:
|
||||||
import asyncio
|
import asyncio
|
||||||
@@ -134,7 +134,8 @@ if __name__ == "__main__":
|
|||||||
while True:
|
while True:
|
||||||
await asyncio.sleep(1.0)
|
await asyncio.sleep(1.0)
|
||||||
messages = await my_consumer.consume(count = 10, timeout = 1.0)
|
messages = await my_consumer.consume(count = 10, timeout = 1.0)
|
||||||
for message in messages: print("MESSAGE:", json.to_string(message["value"]))
|
# for message in messages: print("MESSAGE:", json.to_string(message["value"]))
|
||||||
|
for message in messages: print("MESSAGE:", json.to_string(message.value))
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
await asyncio.gather(*[keep_producing(), keep_consuming()])
|
await asyncio.gather(*[keep_producing(), keep_consuming()])
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ sys.path.append("..")
|
|||||||
from pydantic import BaseModel, Field, field_validator, model_validator, AwareDatetime
|
from pydantic import BaseModel, Field, field_validator, model_validator, AwareDatetime
|
||||||
from typing import Optional, Literal, Union, Dict, List, Any
|
from typing import Optional, Literal, Union, Dict, List, Any
|
||||||
|
|
||||||
# Related to Google:
|
# # Related to Google:
|
||||||
from google.auth.transport.requests import Request
|
# from google.auth.transport.requests import Request
|
||||||
from google.oauth2.credentials import Credentials
|
# from google.oauth2.credentials import Credentials
|
||||||
|
|
||||||
# My utils:
|
# My utils:
|
||||||
from utils_v2.string import json
|
from utils_v2.string import json
|
||||||
|
|||||||
Reference in New Issue
Block a user