Skip to content

Commit

Permalink
Replace multiproccessing with concurrent.futures.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtisvg committed Mar 14, 2018
1 parent cdd7da1 commit 1578a08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spanner/cloud-client/batch_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"""

import argparse
from multiprocessing.pool import ThreadPool
from concurrent.futures import ThreadPoolExecutor
import time

from google.cloud import spanner
Expand Down Expand Up @@ -48,8 +48,8 @@ def run_batch_query(instance_id, database_id):
keyset=spanner.KeySet(all_=True)
)

# pool = multiprocessing.Pool()
pool = ThreadPool()
# Create a pool of workers for the task
pool = ThreadPoolExecutor()
results = []
start = time.time()

Expand Down
1 change: 1 addition & 0 deletions spanner/cloud-client/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
google-cloud-spanner==1.1.0
futures==3.2.0

0 comments on commit 1578a08

Please sign in to comment.