﻿1
00:00:04,830 --> 00:00:07,839
welcome to section two playing with

2
00:00:07,839 --> 00:00:10,750
actors in the previous section we

3
00:00:10,750 --> 00:00:12,609
introduced the actor model and some

4
00:00:12,609 --> 00:00:14,320
important terminologies to get ourselves

5
00:00:14,320 --> 00:00:17,649
started we ended the section by creating

6
00:00:17,649 --> 00:00:21,460
a hello world app in this section we

7
00:00:21,460 --> 00:00:23,289
will take a look at the actor system and

8
00:00:23,289 --> 00:00:26,410
hierarchical structure for actors next

9
00:00:26,410 --> 00:00:28,449
we'll delve into the actor component and

10
00:00:28,449 --> 00:00:31,030
actor lifecycle we then move on to actor

11
00:00:31,030 --> 00:00:33,100
definition and creation with props I

12
00:00:33,100 --> 00:00:35,439
know we created greeter actor in the

13
00:00:35,439 --> 00:00:38,018
previous section but in this section we

14
00:00:38,018 --> 00:00:39,939
will go deeper into the act of creation

15
00:00:39,939 --> 00:00:42,939
and recommended best practices then we

16
00:00:42,939 --> 00:00:45,549
will talk to actors finally we'll

17
00:00:45,549 --> 00:00:48,689
discuss supervision and monitoring

18
00:00:48,689 --> 00:00:51,869
let's start our first video actor system

19
00:00:51,869 --> 00:00:55,289
and hierarchical structure in this video

20
00:00:55,289 --> 00:00:57,600
we will take a look at the actor system

21
00:00:57,600 --> 00:00:59,759
and hierarchical structure for actors

22
00:00:59,759 --> 00:01:02,640
defining the actor system and finally

23
00:01:02,640 --> 00:01:04,879
end with the actor system component

24
00:01:04,879 --> 00:01:08,819
let's get rolling then the actor is an

25
00:01:08,819 --> 00:01:10,829
object that encapsulates the state and

26
00:01:10,829 --> 00:01:13,228
behavior the actors communicate by

27
00:01:13,228 --> 00:01:16,049
exchanging messages you can think about

28
00:01:16,049 --> 00:01:18,810
the actor is a person in the previous

29
00:01:18,810 --> 00:01:21,269
section in the first video itself we

30
00:01:21,269 --> 00:01:22,739
considered you and your friend is an

31
00:01:22,739 --> 00:01:25,829
example from real life in this video we

32
00:01:25,829 --> 00:01:27,539
have another example from our life to

33
00:01:27,539 --> 00:01:29,250
express the hierarchical structure of

34
00:01:29,250 --> 00:01:33,509
actors like in a software team actors

35
00:01:33,509 --> 00:01:36,390
naturally form hierarchies let's express

36
00:01:36,390 --> 00:01:38,909
our life in our team the project manager

37
00:01:38,909 --> 00:01:40,530
receives requirements from the project

38
00:01:40,530 --> 00:01:43,349
owner or a client he applies some

39
00:01:43,349 --> 00:01:45,478
processes on it and distributes it over

40
00:01:45,478 --> 00:01:48,239
the development teams every team leader

41
00:01:48,239 --> 00:01:50,189
takes the requirements and splits it

42
00:01:50,189 --> 00:01:52,469
into smaller tasks and distributes them

43
00:01:52,469 --> 00:01:55,560
over to his entire team every member in

44
00:01:55,560 --> 00:01:57,539
the team takes up a task and completes

45
00:01:57,539 --> 00:01:59,670
it according to his responsibilities and

46
00:01:59,670 --> 00:02:02,189
when he finishes it he reports it to his

47
00:02:02,189 --> 00:02:05,280
leader he gives the status as per

48
00:02:05,280 --> 00:02:07,530
whatever he has completed or hasn't

49
00:02:07,530 --> 00:02:10,038
completed because of some issues in

50
00:02:10,038 --> 00:02:13,289
other words every team member needs to

51
00:02:13,289 --> 00:02:15,719
complete a particular task maybe do it

52
00:02:15,719 --> 00:02:18,270
himself or split it into smaller tasks

53
00:02:18,270 --> 00:02:20,340
distribute them over to his team and

54
00:02:20,340 --> 00:02:23,969
managers team to complete it let's

55
00:02:23,969 --> 00:02:26,150
Express the situation in the actor world

56
00:02:26,150 --> 00:02:29,129
one actor which is to oversee a certain

57
00:02:29,129 --> 00:02:31,259
function in the program might want to

58
00:02:31,259 --> 00:02:33,330
split up its tasks into smaller more

59
00:02:33,330 --> 00:02:36,568
manageable pieces for this purpose it

60
00:02:36,568 --> 00:02:38,759
starts child actors which it supervises

61
00:02:38,759 --> 00:02:40,919
and if one actor does not have the means

62
00:02:40,919 --> 00:02:43,110
for dealing with a certain situation it

63
00:02:43,110 --> 00:02:45,150
sends a corresponding failure message to

64
00:02:45,150 --> 00:02:48,539
its supervisor asking for help now for

65
00:02:48,539 --> 00:02:49,729
the question of the hour

66
00:02:49,729 --> 00:02:53,669
what's the actor system the actor system

67
00:02:53,669 --> 00:02:56,370
is our route of the actors structure the

68
00:02:56,370 --> 00:02:58,349
actor system as a collaborating failure

69
00:02:58,349 --> 00:03:00,719
ensemble of actors is the natural unit

70
00:03:00,719 --> 00:03:02,129
for managing shed pasilla

71
00:03:02,129 --> 00:03:03,960
tee's such as scheduling services

72
00:03:03,960 --> 00:03:08,400
configuration and logging now let's take

73
00:03:08,400 --> 00:03:09,900
an overview of the actor system

74
00:03:09,900 --> 00:03:12,870
components the dead-letter office is an

75
00:03:12,870 --> 00:03:15,180
actor structurally no different from any

76
00:03:15,180 --> 00:03:17,580
other actor anytime a message is

77
00:03:17,580 --> 00:03:18,810
destined for an actor that either

78
00:03:18,810 --> 00:03:19,830
doesn't exist

79
00:03:19,830 --> 00:03:21,990
or is not running it goes to the

80
00:03:21,990 --> 00:03:24,840
dead-letter office the user guardian

81
00:03:24,840 --> 00:03:27,150
actor is the parent of all actors we

82
00:03:27,150 --> 00:03:29,849
create from the actor system for

83
00:03:29,849 --> 00:03:31,919
internal actors that Acker creates to

84
00:03:31,919 --> 00:03:34,229
assist you there is a system Guardian

85
00:03:34,229 --> 00:03:36,780
actor it serves the same purpose as the

86
00:03:36,780 --> 00:03:39,300
user guardian actor but for system

87
00:03:39,300 --> 00:03:42,240
actors the scheduler is a part of the

88
00:03:42,240 --> 00:03:44,039
actor system responsible for scheduling

89
00:03:44,039 --> 00:03:46,919
things that may arise in the future the

90
00:03:46,919 --> 00:03:49,080
event stream is the main event bus of

91
00:03:49,080 --> 00:03:51,719
each actor system it is used to carry

92
00:03:51,719 --> 00:03:54,449
log messages and dead letters you can

93
00:03:54,449 --> 00:03:56,639
also use it to publish messages across

94
00:03:56,639 --> 00:04:00,030
your entire actor system akka uses a new

95
00:04:00,030 --> 00:04:02,189
configuration system that's useful for

96
00:04:02,189 --> 00:04:04,259
configuring akka and your application

97
00:04:04,259 --> 00:04:07,020
you can access it from the actor system

98
00:04:07,020 --> 00:04:09,479
the part of the actor system with which

99
00:04:09,479 --> 00:04:11,520
we've interacted mostly has been the

100
00:04:11,520 --> 00:04:14,340
user guardian the user guardian is the

101
00:04:14,340 --> 00:04:15,870
parent for the actors we create from

102
00:04:15,870 --> 00:04:18,029
actor system which watches and takes

103
00:04:18,029 --> 00:04:21,029
care of them to summarize the concepts

104
00:04:21,029 --> 00:04:23,430
of this video we have talked about actor

105
00:04:23,430 --> 00:04:25,529
system its components and the

106
00:04:25,529 --> 00:04:27,324
hierarchical structure for actors


