Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 0 additions & 100 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,107 +1,7 @@
name: Test EasyRpc Core Functionality
on: ['pull_request']
jobs:
test_easyrpc_core_37:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
#container: joshjamison/python38:latest
strategy:
matrix:
python-version: [3.7]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest requests pytest-asyncio
- name: Test EasyRpc Core Functionality
run: |
pytest tests/test_core.py
test_easyrpc_cluster_1_37:
needs: test_easyrpc_core_37
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
#container: joshjamison/python38:latest
strategy:
matrix:
python-version: [3.7]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest requests pytest-asyncio
- name: Test EasyRpc Cluster Functionality - 1
run: |
pytest tests/test_clustering_1.py
test_easyrpc_cluster_2_37:
needs: test_easyrpc_cluster_1_37
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
#container: joshjamison/python38:latest
strategy:
matrix:
python-version: [3.7]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest requests pytest-asyncio
- name: Test EasyRpc Cluster Functionality - 2
run: |
pytest tests/test_clustering_2.py
test_easyrpc_cluster_3_37:
needs: test_easyrpc_cluster_2_37
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
#container: joshjamison/python38:latest
strategy:
matrix:
python-version: [3.7]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest requests pytest-asyncio
- name: Test EasyRpc Cluster Functionality - 3
run: |
pytest tests/test_clustering_3.py
test_easyrpc_core_38:
needs: test_easyrpc_cluster_3_37
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
Expand Down
100 changes: 0 additions & 100 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,108 +4,8 @@ on:
tags:
- "*"
jobs:
test_easyrpc_core:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
#container: joshjamison/python38:latest
strategy:
matrix:
python-version: [3.8]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest requests pytest-asyncio
- name: Test EasyRpc Core Functionality
run: |
pytest tests/test_core.py
test_easyrpc_cluster_1:
# Containers must run in Linux based operating systems
needs: test_easyrpc_core
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
#container: joshjamison/python38:latest
strategy:
matrix:
python-version: [3.8]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest requests pytest-asyncio
- name: Test EasyRpc Cluster Functionality - 1
run: |
pytest tests/test_clustering_1.py
test_easyrpc_cluster_2:
needs: test_easyrpc_cluster_1
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
#container: joshjamison/python38:latest
strategy:
matrix:
python-version: [3.8]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest requests pytest-asyncio
- name: Test EasyRpc Cluster Functionality - 2
run: |
pytest tests/test_clustering_2.py
test_easyrpc_cluster_3:
needs: test_easyrpc_cluster_2
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
#container: joshjamison/python38:latest
strategy:
matrix:
python-version: [3.8]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install pytest requests pytest-asyncio
- name: Test EasyRpc Cluster Functionality - 3
run: |
pytest tests/test_clustering_3.py
package:
name: Package easyrpc for PyPI
needs: test_easyrpc_cluster_3
runs-on: ubuntu-latest
steps:
# Downloads a copy of the code in your repository before running CI tests
Expand Down
4 changes: 2 additions & 2 deletions easyrpc/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async def create(cls,

def run_cron(self, action, interval):
async def cron():
self.log.warning(f"creating cron or {action.__name__} - interval {interval}")
self.log.debug(f"creating cron or {action.__name__} - interval {interval}")
tasks = []
while True:
try:
Expand Down Expand Up @@ -466,7 +466,7 @@ async def ws_client():
ws_sender = self.get_ws_sender(ws)
ws_receiver = self.get_ws_receiver(ws)

self.log.warning(
self.log.debug(
f"started connection to server {self.origin_host}:{self.origin_port}"
)
async def keep_alive():
Expand Down
3 changes: 2 additions & 1 deletion easyrpc/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ async def __proxy__(*args, **kwargs):
return await result
return result

#__proxy__.__name__ = f"{config['name']}_proxy"
__proxy__.__name__ = f"{config['name']}"
__proxy__.__doc__ = config.get('doc', '')
nf = create_function(
create_signature_from_dict(
config['sig']
Expand Down Expand Up @@ -126,6 +126,7 @@ def register(f, namespace):
obj.namespaces[namespace][f.__name__]['config'] = {
'sig': get_signature_as_dict(f),
'name': f.__name__,
'doc': f.__doc__,
'is_async': iscoroutinefunction(f)
}
obj.namespaces[namespace][f.__name__]['method'] = f
Expand Down
6 changes: 3 additions & 3 deletions easyrpc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ async def connect(self, websocket: WebSocket):
return await websocket.accept()

def store_connect(self, endpoint_id, websocket: WebSocket):
self.log.warning(f"created websocket connection with endpoint {endpoint_id}")
self.log.debug(f"created websocket connection with endpoint {endpoint_id}")
self.active_connections[endpoint_id] = websocket

def disconnect(self, endpoint_id: str):
self.log.warning(f"deleted websocket connection with endpoint {endpoint_id}")
self.log.debug(f"deleted websocket connection with endpoint {endpoint_id}")
del self.active_connections[endpoint_id]
async def broadcast(self, message: str):
for connection in self.active_connections:
Expand Down Expand Up @@ -422,7 +422,7 @@ async def ws_receiver():
await finished.get()

# child connection closed
self.log.warning(f"client websocket connection with id {decoded_id} finished")
self.log.debug(f"client websocket connection with id {decoded_id} finished")

# check if child is server or proxy
if setup['type'] == 'SERVER':
Expand Down
Loading