-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dea30d8
commit 0ded3f3
Showing
29 changed files
with
266 additions
and
204 deletions.
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ services: | |
- pyramid_network | ||
ports: | ||
- 5678:5678 | ||
- 5679:5679 | ||
env_file: .env | ||
|
||
networks: | ||
|
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
from abc import ABC, abstractmethod | ||
from pyramid.data.functional.application_info import ApplicationInfo | ||
from abc import abstractmethod | ||
|
||
class ISocketServerService(ABC): | ||
|
||
class ISocketServerService: | ||
|
||
@abstractmethod | ||
async def open(self): | ||
pass | ||
|
||
@abstractmethod | ||
def start(self): | ||
def close(self): | ||
pass |
This file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file contains 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 file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import json | ||
import logging | ||
import sys | ||
from pyramid.client.requests.a_request import ARequest | ||
from pyramid.client.requests.ask_request import AskRequest | ||
from pyramid.client.responses.a_response_header import ResponseHeader | ||
from pyramid.data.ping import PingSocket | ||
|
||
|
||
class PingRequest(ARequest): | ||
def __init__(self) -> None: | ||
super().__init__(AskRequest("health")) | ||
|
||
def load_data(self, **data) -> PingSocket: | ||
return PingSocket(**data) | ||
|
||
def client_receive(self, header: ResponseHeader, data: PingSocket) -> bool: | ||
data_json = json.dumps(data.__dict__, indent=4) | ||
|
||
if not data.is_ok(): | ||
logging.warning("Health check failed") | ||
print(data_json) | ||
return False | ||
logging.info("Health check valid") | ||
print(data_json) | ||
return True |
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from typing import Any, Self | ||
from pyramid.client.a_socket import ASocket | ||
from pyramid.client.common import ResponseCode, SocketCommon | ||
# from pyramid.client.common import ResponseCode, SocketHeader | ||
|
||
|
||
# class ReponseHeader(SocketHeader): | ||
class ResponseHeader: | ||
def __init__(self, code: ResponseCode, message: str | None) -> None: | ||
# super().__init__(self.__class__) | ||
self.code = code | ||
self.message = message |
Oops, something went wrong.