Use new global var stack from tractor

to_qpainterpath_and_beyond
Tyler Goodlet 2020-11-16 11:41:33 -05:00
parent 9572280553
commit c625dc90f1
1 changed files with 6 additions and 5 deletions

View File

@ -216,6 +216,7 @@ class ShmArray:
_lotsa_5s = int(5*60*60*10/5) _lotsa_5s = int(5*60*60*10/5)
def open_shm_array( def open_shm_array(
key: Optional[str] = None, key: Optional[str] = None,
# approx number of 5s bars in a "day" x2 # approx number of 5s bars in a "day" x2
@ -263,9 +264,9 @@ def open_shm_array(
# "unlink" created shm on process teardown by # "unlink" created shm on process teardown by
# pushing teardown calls onto actor context stack # pushing teardown calls onto actor context stack
actor = tractor.current_actor() tractor._actor._lifetime_stack.callback(shmarr.close)
actor._lifetime_stack.callback(shmarr.close) tractor._actor._lifetime_stack.callback(shmarr.destroy)
actor._lifetime_stack.callback(shmarr.destroy)
return shmarr return shmarr
@ -310,8 +311,8 @@ def attach_shm_array(
_known_tokens[key] = token _known_tokens[key] = token
# "close" attached shm on process teardown # "close" attached shm on process teardown
actor = tractor.current_actor() tractor._actor._lifetime_stack.callback(sha.close)
actor._lifetime_stack.callback(sha.close)
return sha return sha