Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added documentation for SysVCacheItemPool #995

Merged
merged 3 commits into from
Apr 6, 2018

Conversation

@tmatsuo tmatsuo requested a review from dwsupplee April 5, 2018 23:45
@tmatsuo tmatsuo requested a review from jdpedrie as a code owner April 5, 2018 23:45
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 5, 2018
Copy link
Contributor

@dwsupplee dwsupplee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These updates look great.

For the bit regarding spanner and sessions, WDYT about a note linking out to here for guiding users on more information on how to use the session pool?

README.md Outdated
@@ -1005,6 +1005,21 @@ $storage = new StorageClient([
]);
```

The [Google Auth library](https://github.com/google/google-auth-library-php) provides a PSR-6 implementation with the SystemV shared memory. This implementation is only available on *nix machines, but it's the one of the fastest implementations and you can share the cache among multiple processes. The following example shows how to use it.

This comment was marked as spam.

This comment was marked as spam.


$sessionPool = new CacheSessionPool(
$sessionCache,
['minSession' => 10,

This comment was marked as spam.


## Session warmup

To issue a query against the Spanner service, the client library needs to request a session id to the server under the cover. This API call will add significant latency to your program. The Spanner client library provides a handy way to alleviate this problem by having a cached session pool.

This comment was marked as spam.


$authCache = new SysVCacheItemPool();
$sessionCache = new SysVCacheItemPool([
'proj' => 'B' // Use different from the default

This comment was marked as spam.

This comment was marked as spam.

);

$database = $client->connect(
$instance,

This comment was marked as spam.

$db,
['sessionPool' => $sessionPool]
);
// `warmup` will actually create the session for the first time.

This comment was marked as spam.

@dwsupplee
Copy link
Contributor

Additionally, we could now update this verbiage.

@tmatsuo tmatsuo changed the title Docs for 989 Added documentation for SysVCacheItemPool Apr 6, 2018
@tmatsuo tmatsuo merged commit 9e76550 into googleapis:master Apr 6, 2018
@tmatsuo tmatsuo deleted the docs-for-989 branch April 6, 2018 21:28
@dwsupplee dwsupplee mentioned this pull request Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants