Skip to content

Commit 259c141

Browse files
committed
Finish removing 'concurrency' and fix some subtle bugs
1 parent 61fd236 commit 259c141

6 files changed

Lines changed: 17 additions & 18 deletions

File tree

examples/basic_server_from_yaml.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
# Run interactively to have the server stay up and then terminate using server.stop()
2-
import time
3-
4-
from p4pillon import concurrency, config_reader
5-
6-
if concurrency == "thread":
7-
from p4pillon.thread.server import Server
8-
elif concurrency == "asyncio":
9-
from p4pillon.asyncio.server import Server
10-
else:
11-
raise ValueError(f"Unknown value for concurrency: {concurrency}")
12-
132
# Uncomment the lines below to turn on debugging output to the screen
143
import logging
4+
import time
5+
6+
from p4pillon import config_reader
7+
from p4pillon.thread.server import Server
158

169
logging.getLogger().setLevel(logging.DEBUG)
1710
logging.getLogger().addHandler(logging.StreamHandler())

p4pillon/asyncio/pvrecipe.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
from ..pvrecipe import * # noqa: F403
1+
from typing import TypeVar
2+
3+
from p4pillon.pvrecipe import * # noqa: F403
4+
from p4pillon.server.thread import SharedPV as _SharedPV
5+
6+
SharedPV = _SharedPV
7+
8+
SharedPvT = TypeVar("SharedPvT", bound=_SharedPV)

p4pillon/asyncio/sharednt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from p4pillon.sharednt import SharedNT # noqa: I001
1+
from p4pillon.sharednt import SharedNT # noqa: I001
22

3-
from p4pillon.server.thread import SharedPV as _SharedPV
3+
from p4pillon.server.asyncio import SharedPV as _SharedPV
44

55
SharedNT.SharedPV = _SharedPV

p4pillon/server/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from p4p.client.raw import Context
1010
from p4p.server import Server as _Server
1111
from p4p.server import StaticProvider
12-
from p4p.server.raw import SharedPV
1312

1413
from p4pillon.pvrecipe import BasePVRecipe
14+
from p4pillon.server.raw import SharedPV
1515

1616
logger = logging.getLogger(__name__)
1717

p4pillon/thread/pvrecipe.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from typing import TypeVar
22

3-
from p4p.server.thread import SharedPV as _SharedPV
4-
53
from p4pillon.pvrecipe import * # noqa: F403
4+
from p4pillon.server.thread import SharedPV as _SharedPV
65

76
SharedPV = _SharedPV
87

p4pillon/thread/sharednt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from p4pillon.sharednt import SharedNT # noqa: I001
1+
from p4pillon.sharednt import SharedNT # noqa: I001
22

33
from p4pillon.server.thread import SharedPV as _SharedPV
44

0 commit comments

Comments
 (0)