|
12 | 12 | <methodsynopsis>
|
13 | 13 | <type>mixed</type><methodname>apcu_entry</methodname>
|
14 | 14 | <methodparam><type>string</type><parameter>key</parameter></methodparam>
|
15 |
| - <methodparam><type>callable</type><parameter>generator</parameter></methodparam> |
| 15 | + <methodparam><type>callable</type><parameter>callback</parameter></methodparam> |
16 | 16 | <methodparam choice="opt"><type>int</type><parameter>ttl</parameter><initializer>0</initializer></methodparam>
|
17 | 17 | </methodsynopsis>
|
18 | 18 | <para>
|
19 |
| - Atomically attempts to find <parameter>key</parameter> in the cache, if it cannot be found <parameter>generator</parameter> |
| 19 | + Atomically attempts to find <parameter>key</parameter> in the cache, if it cannot be found <parameter>callback</parameter> |
20 | 20 | is called, passing <parameter>key</parameter> as the only argument. The return value of the call is then cached with the optionally specified
|
21 | 21 | <parameter>ttl</parameter>, and returned.
|
22 | 22 | </para>
|
23 | 23 | <note>
|
24 | 24 | <simpara>
|
25 | 25 | When control enters <function>apcu_entry</function> the lock for the cache is acquired exclusively, it is released when control leaves <function>apcu_entry</function>:
|
26 |
| - In effect, this turns the body of <parameter>generator</parameter> into a critical section, disallowing two processes from executing the same code paths concurrently. |
| 26 | + In effect, this turns the body of <parameter>callback</parameter> into a critical section, disallowing two processes from executing the same code paths concurrently. |
27 | 27 | In addition, it prohibits the concurrent execution of any other APCu functions, since they will acquire the same lock.
|
28 | 28 | </simpara>
|
29 | 29 | </note>
|
30 | 30 | <warning>
|
31 | 31 | <simpara>
|
32 |
| - The only APCu function that can be called safely by <parameter>generator</parameter> is <function>apcu_entry</function>. |
| 32 | + The only APCu function that can be called safely by <parameter>callback</parameter> is <function>apcu_entry</function>. |
33 | 33 | </simpara>
|
34 | 34 | </warning>
|
35 | 35 | </refsect1>
|
|
46 | 46 | </listitem>
|
47 | 47 | </varlistentry>
|
48 | 48 | <varlistentry>
|
49 |
| - <term><parameter>generator</parameter></term> |
| 49 | + <term><parameter>callback</parameter></term> |
50 | 50 | <listitem>
|
51 | 51 | <para>
|
52 | 52 | A callable that accepts <parameter>key</parameter> as the only argument and returns the value to cache.
|
|
0 commit comments