Skip to content

Commit

Permalink
Adds SharedMemoryDROP case for use without session present.
Browse files Browse the repository at this point in the history
  • Loading branch information
pritchardn committed Jan 11, 2022
1 parent 98ed8e7 commit 30c4c78
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions daliuge-engine/dlg/drop.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"""
Module containing the core DROP classes.
"""

import string
from abc import ABCMeta, abstractmethod
import ast
import base64
Expand Down Expand Up @@ -1471,8 +1471,14 @@ def initialize(self, **kwargs):
self._buf = io.BytesIO(*args)

def getIO(self):
if hasattr(self, '_sessID') and sys.version_info >= (3, 8):
return SharedMemoryIO(self.oid, self._sessID)
print(sys.version_info)
if sys.version_info >= (3, 8):
if hasattr(self, '_sessID'):
return SharedMemoryIO(self.oid, self._sessID)
else:
# Using Drop without manager, just generate a random name.
sess_id = ''.join(random.choices(string.ascii_uppercase + string.digits, k=10))
return SharedMemoryIO(self.oid, sess_id)
else:
raise NotImplementedError("Shared memory is only available with Python >= 3.8")

Expand Down Expand Up @@ -2176,6 +2182,7 @@ def getIO(self):
def dataURL(self):
return "plasmaflight://%s" % (binascii.hexlify(self.object_id).decode("ascii"))


##
# @brief ParameterSet
# @details A set of parameters, wholly specified in EAGLE
Expand Down

0 comments on commit 30c4c78

Please sign in to comment.