From c625dc90f1e97665c7c0fb71581bd9856e6cd064 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 16 Nov 2020 11:41:33 -0500 Subject: [PATCH] Use new global var stack from tractor --- piker/data/_sharedmem.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/piker/data/_sharedmem.py b/piker/data/_sharedmem.py index 77dac544..a992a2b2 100644 --- a/piker/data/_sharedmem.py +++ b/piker/data/_sharedmem.py @@ -216,6 +216,7 @@ class ShmArray: _lotsa_5s = int(5*60*60*10/5) + def open_shm_array( key: Optional[str] = None, # approx number of 5s bars in a "day" x2 @@ -263,9 +264,9 @@ def open_shm_array( # "unlink" created shm on process teardown by # pushing teardown calls onto actor context stack - actor = tractor.current_actor() - actor._lifetime_stack.callback(shmarr.close) - actor._lifetime_stack.callback(shmarr.destroy) + tractor._actor._lifetime_stack.callback(shmarr.close) + tractor._actor._lifetime_stack.callback(shmarr.destroy) + return shmarr @@ -310,8 +311,8 @@ def attach_shm_array( _known_tokens[key] = token # "close" attached shm on process teardown - actor = tractor.current_actor() - actor._lifetime_stack.callback(sha.close) + tractor._actor._lifetime_stack.callback(sha.close) + return sha