removed code related to eager endpoint

This commit is contained in:
Matthias Bisping 2022-05-05 17:25:42 +02:00
parent 68c24c863f
commit 1b04c46853
4 changed files with 5 additions and 44 deletions

View File

@ -32,10 +32,6 @@ class Processor(abc.ABC):
self.execution_queue = chain([])
self.processor_fn = processor_fn
# def run(self, package, final):
# """Eagerly execute processor function and return result immediately."""
# return self.processor_fn(package, final=final)
def submit(self, package, final):
"""Submit computation request to execution queue; computation is performed on demand.
@ -61,11 +57,6 @@ def set_up_processing_server(process_fn):
resp.status_code = 200
return resp
# @app.route("/process", methods=["POST", "PATCH"])
# def process():
# response_payload = processor.run(request.json, final=request.method == "POST")
# return jsonify(response_payload)
@app.route("/submit", methods=["POST", "PATCH"])
def submit():
processor.submit(request.json, final=request.method == "POST")

View File

@ -1,12 +0,0 @@
# import pytest
# from funcy import lmap
#
# from pyinfra.server.rest import process_eagerly
# from pyinfra.server.utils import unpack
#
#
# @pytest.mark.parametrize("batched", [True, False])
# @pytest.mark.parametrize("item_type", ["pdf", "string", "image"])
# def test_sending_partial_request(url, input_data_items, metadata, target_data_items, server_process):
# output = lmap(unpack, process_eagerly(f"{url}/process", input_data_items, metadata))
# assert output == target_data_items

View File

@ -38,11 +38,8 @@ def target_data_items(input_data_items, item_type, operation, metadata):
@pytest.fixture
def endpoint(url, analysis_type):
return {
# "eager": f"{url}/process",
"lazy": f"{url}/submit",
}[analysis_type]
def endpoint(url):
return f"{url}/submit"
@pytest.fixture(params=[0, 2, 5])
@ -55,16 +52,6 @@ def n_pages(request):
return request.param
@pytest.fixture(
params=[
# "eager",
"lazy",
]
)
def analysis_type(request):
return request.param
@pytest.fixture(params=[1, 5])
def buffer_size(request):
return request.param

View File

@ -39,9 +39,7 @@ def test_mock_pipeline():
)
@pytest.mark.parametrize(
"n_pages",
[
100
],
[100],
)
def test_pipeline(pipeline, input_data_items, metadata, target_data_items):
output = lmap(unpack, pipeline(input_data_items, metadata))
@ -59,8 +57,5 @@ def rest_pipeline(server_process, endpoint, rest_interpreter):
@pytest.fixture
def rest_interpreter(analysis_type):
return {
"eager": IdentityInterpreter(),
"lazy": rcompose(RestPickupStreamer(), RestReceiver()),
}[analysis_type]
def rest_interpreter():
rcompose(RestPickupStreamer(), RestReceiver())