Last active
January 6, 2018 13:33
-
-
Save nilleb/419122f2f6f1228650dd2dccbd01c5af to your computer and use it in GitHub Desktop.
Hack: use google-cloud-spanner in a google-app-engine app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.appengine.ext import vendor | |
vendor.add('vendor/libs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
class DummyProcess(object): | |
def start(self, target): | |
target() | |
class DummyProcessing(ModuleType): | |
def __init__(self): | |
pass | |
@staticmethod | |
def Process(target): | |
return DummyProcess(target) | |
@staticmethod | |
def Queue(): | |
return Queue() | |
sys.modules['multiprocessing'] = DummyProcessing | |
sys.modules['dill'] = pickle | |
from google.cloud import spanner | |
# your google-cloud-spanner consumer code goes here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd vendor/libs | |
pip install --upgrade -t . google-cloud google-cloud-core==0.23.0 google-cloud-spanner | |
cd ../.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment