@@ -434,10 +434,10 @@ defmodule GenServer do
434
434
except the process is hibernated before entering the loop. See
435
435
`c:handle_call/3` for more information on hibernation.
436
436
437
- Returning `{:ok, state, {:continue, continue }}` is similar to
437
+ Returning `{:ok, state, {:continue, request }}` is similar to
438
438
`{:ok, state}` except that immediately after entering the loop,
439
439
the `c:handle_continue/2` callback will be invoked with the value
440
- `continue ` as first argument.
440
+ `request ` as the first argument and `state` as the second one .
441
441
442
442
Returning `:ignore` will cause `start_link/3` to return `:ignore` and
443
443
the process will exit normally without entering the loop or calling
@@ -460,7 +460,7 @@ defmodule GenServer do
460
460
"""
461
461
@ callback init ( init_arg :: term ) ::
462
462
{ :ok , state }
463
- | { :ok , state , timeout | :hibernate | { :continue , term } }
463
+ | { :ok , state , timeout | :hibernate | { :continue , request :: term } }
464
464
| :ignore
465
465
| { :stop , reason :: any }
466
466
when state: any
@@ -487,9 +487,9 @@ defmodule GenServer do
487
487
`GenServer` causes garbage collection and leaves a continuous heap that
488
488
minimises the memory used by the process.
489
489
490
- Returning `{:reply, reply, new_state, {:continue, continue }}` is similar to
490
+ Returning `{:reply, reply, new_state, {:continue, request }}` is similar to
491
491
`{:reply, reply, new_state}` except `c:handle_continue/2` will be invoked
492
- immediately after with the value `continue ` as first argument.
492
+ immediately after with the value `request ` as the first argument and `state` as the second one .
493
493
494
494
Hibernating should not be used aggressively as too much time could be spent
495
495
garbage collecting. Normally it should only be used when a message is not
@@ -512,7 +512,7 @@ defmodule GenServer do
512
512
process exits without replying as the caller will be blocking awaiting a
513
513
reply.
514
514
515
- Returning `{:noreply, new_state, timeout | :hibernate | {:continue, continue }}`
515
+ Returning `{:noreply, new_state, timeout | :hibernate | {:continue, request }}`
516
516
is similar to `{:noreply, new_state}` except a timeout, hibernation or continue
517
517
occurs as with a `:reply` tuple.
518
518
@@ -528,9 +528,9 @@ defmodule GenServer do
528
528
"""
529
529
@ callback handle_call ( request :: term , from , state :: term ) ::
530
530
{ :reply , reply , new_state }
531
- | { :reply , reply , new_state , timeout | :hibernate | { :continue , term } }
531
+ | { :reply , reply , new_state , timeout | :hibernate | { :continue , request :: term } }
532
532
| { :noreply , new_state }
533
- | { :noreply , new_state , timeout | :hibernate | { :continue , term } }
533
+ | { :noreply , new_state , timeout | :hibernate | { :continue , request :: term } }
534
534
| { :stop , reason , reply , new_state }
535
535
| { :stop , reason , new_state }
536
536
when reply: term , new_state: term , reason: term
@@ -551,9 +551,10 @@ defmodule GenServer do
551
551
`{:noreply, new_state}` except the process is hibernated before continuing the
552
552
loop. See `c:handle_call/3` for more information.
553
553
554
- Returning `{:noreply, new_state, {:continue, continue }}` is similar to
554
+ Returning `{:noreply, new_state, {:continue, request }}` is similar to
555
555
`{:noreply, new_state}` except `c:handle_continue/2` will be invoked
556
- immediately after with the value `continue` as first argument.
556
+ immediately after with the value `request` as the first argument and
557
+ `state` as the second one.
557
558
558
559
Returning `{:stop, reason, new_state}` stops the loop and `c:terminate/2` is
559
560
called with the reason `reason` and state `new_state`. The process exits with
@@ -564,7 +565,7 @@ defmodule GenServer do
564
565
"""
565
566
@ callback handle_cast ( request :: term , state :: term ) ::
566
567
{ :noreply , new_state }
567
- | { :noreply , new_state , timeout | :hibernate | { :continue , term } }
568
+ | { :noreply , new_state , timeout | :hibernate | { :continue , request :: term } }
568
569
| { :stop , reason :: term , new_state }
569
570
when new_state: term
570
571
@@ -581,26 +582,26 @@ defmodule GenServer do
581
582
"""
582
583
@ callback handle_info ( msg :: :timeout | term , state :: term ) ::
583
584
{ :noreply , new_state }
584
- | { :noreply , new_state , timeout | :hibernate | { :continue , term } }
585
+ | { :noreply , new_state , timeout | :hibernate | { :continue , request :: term } }
585
586
| { :stop , reason :: term , new_state }
586
587
when new_state: term
587
588
588
589
@ doc """
589
- Invoked to handle ` continue` instructions.
590
+ Invoked to handle continue request instructions.
590
591
591
592
It is useful for performing work after initialization or for splitting the work
592
593
in a callback in multiple steps, updating the process state along the way.
593
594
594
595
Return values are the same as `c:handle_cast/2`.
595
596
596
597
This callback is optional. If one is not implemented, the server will fail
597
- if a continue instruction is used.
598
+ if a continue request instruction is used.
598
599
"""
599
- @ callback handle_continue ( continue :: term , state :: term ) ::
600
+ @ callback handle_continue ( request , state :: term ) ::
600
601
{ :noreply , new_state }
601
- | { :noreply , new_state , timeout | :hibernate | { :continue , term } }
602
+ | { :noreply , new_state , timeout | :hibernate | { :continue , request } }
602
603
| { :stop , reason :: term , new_state }
603
- when new_state: term
604
+ when new_state: term , request: term
604
605
605
606
@ doc """
606
607
Invoked when the server is about to exit. It should do any cleanup required.
0 commit comments