Assign a driver to them first, right? But
what can happen is let's say I opened my
Uber app for you I But what can happen is
that you can get a driver assigned before
me. That can still happen, right? But
Uber will try to assign me a driver
before you. But what will happen is maybe
the driver is not accepting, right? So
Uber does not wait if they have a million
customers. Yeah, the first customer gets
all the five. No, that, yeah, that that
can happen. That can happen, right. Let's
say I'm a better customer. Yeah. So that
that's that's true. We we we cannot. I
mean, if you want to do it, then what you
have to do is you'll have to make sure
that you go through all the cores then
yes, that yeah, we need to make sure. I'm
not sure where this logic. Believe if one
has been assigned, then you go to the
second one, then you come back and see
what happened to the status for this one.
It still remains in progress, right? It
still remains in scheduled state if it
hasn't been answered. So now again in the
second iteration of the scheduler, it
should get picked up again, correct?
Right. If it hasn't been assigned because
if it's. Present torture ID becomes null,
right? So it gets picked up again.
So I think this will be handled in the
scheduler again if I send the
notification to two. If it does not
answer, the torch ID stays null right? So
yeah, that means in the next iteration of
scheduler it will see the only thing
though. Ohh this is a problem now let's
say 2 does not answer right when the
scheduler picks it up again. Right, Do we
need to mark the iteration of the
scheduler? Because now we know 2 was
busy. Right or no? This
is how will you handle this case or
maybe what's the flow over here,
Malaysian Anthony, let's say scheduler
runs, you pick up this lead, right? It
has 2314. You start hanging the phone for
two, right? 2 does not answer. Is that
in the same loop, same iteration of the
scheduler?Does it go to three or does it
get picked up in the second time the
scheduler runs?No, it goes
to the next three right in the
same one only right. OK, Yeah, yeah.
In the in the same flow like
like we, we we run that loop
for how many PCs in the 2314?
Yeah. So it goes one by one,
it goes to 2 and then 314.
Yeah, if, if none of them, Yeah, if
none of them answered, then again
scheduler picks for the next one. Yeah.
So I think we need to assign introduce
a new status, maybe P status or somebody
status like intermediate, because then
can you do a distinct P status? Yeah,
I think it's active in. Inactive only.
OK.
Inactive and active and inactive. So
probably maybe something as pick,
something like that. Pick, pick whatever
intermediary state. Yeah. Because when
they are in a call, it
shows as inactive, correct. Yeah. OK.
So inactive when he doesn't attend
the. Either he accept or reject
that when he didn't do both it will
be inactive. Exactly. But when he
accepts, then it's also inactive, right?
Because technically he's not active with
active. No, when he accepts, it is busy.
Ohh, really? Yeah, busy. OK, OK, OK. So
when he accepts, he's busy. So I feel
like it can be busy when the phone
is ringing, it can come as busy.
Um, yeah, the same thing. Technically
you can use busy, you can
recycle busy again. Yeah, you can
recycle it. Only thing I'm looking,
do we have any use case
where we have to distinguish both
the status?
If not, we can make you busy.
Yeah. So far I'm thinking the cases, the
business case for in, in call or while
ringing is the same, right? So we can
handle it the same way. But if there
is a need to make it different, we
can do it, We can introduce a new
status, right? And then when?And the call
goes through, you set the status to
something else if they call. If they
don't answer the call, they are set to
inactive. I think we already have code
for that, correct? If the call goes
through, they don't answer in 60 seconds,
the status becomes inactive, correct?
Yes, but there's no. But the status
remains active while the phone isringing.
Yeah. Can you also confirm that piece?
Because I think because I remember when
Anthony and I, we were doing some
debugging, when the phone starts ringing,
it becomes something else. Right,
Anthony, maybe I cannot remember
correctly. Maybe it
goes, uh, we will check,
OK. Yeah,
Anthony, yeah, checked in the websocket,
when the call goes through, when you are
getting the message, right, right. When
you send the message to front end the
Torch member, what is the status for
that? PS Right. I think I'm done. So
yeah, go ahead. No, no, go ahead, please.
No, no, no. Declines maybe?
What is the status at that point of
time? I forgot, maybe busy at that time
as well?Maybe if that
is the case, we have to introduce
a intermediary.
Yeah. So technically if you declines, we
should set him to inactive because I feel
Malaysia this is active or inactive,
right. So if you are active, inactive or
busy maybe, but the scheduler should only
pick up someone that is active, right. So
if someone's phone is ringing because the
schedule picks up not equal to active.
Right, if you see the code right.
I don't have the code right now, but if
you see the go, it picks up anything that
is not active. So while the phone is
thinking it doesn't matter if you do busy
or some other status, we can do some
other status, call it ringing or uh. So,
yeah, it's just one word, right? We can
introduce that status and then go from
there so that we make sure when the phone
is ringing for one, right, phone is
ringing for two, then it's time to take
lead one. It does not, It goes to lead 4,
right? And then it goes to lead 3, right.
So I think, I think this will be part of.
Your piece, correct? Yeah, Yeah, sorry,
my piece. Right. So
Anthony, make sure you account for this.
See how the statuses are behaving today.
And if you need to introduce a new status
and introduce a new status and account
for this while the food is singing for
two, right? You set the status for VPS 2
to something else that is not active
because when you come to lead one, right,
it should not. Ring the phone for Lee, 2.
OK, OK. I think better to introduce a
intermediary stage. Yeah, even for the,
even for the better understanding of the
code Exactly for antics and all. Exactly
if you want to see. Yeah, if you want
to debug it. Alright, you can, You can
really see who's busy now, right? No, I
do agree with you. It's more.
Debilitation. Yep, for sure. So
we maybe we can call
it ringing. Yeah, thinking or
pick whatever, Yeah, yeah, phone ringing,
right, so yeah, yeah, ringing we can
yeah, yeah, all lower case, Anthony,
since this is lower case, right, So
Anthony, as part of your website logic,
when you send a message to the first
VPS, right, who is available, who is
active and the connection has been.
Yeah, right. You set it to ringing. If
he answers, it becomes busy. If he does
not answers it, it becomes inactive.
Exactly. Yeah. Correct. So are
we, I'm glad we talked to this edge
case, right? Yeah, yeah.
OK, so I think we have a solid design. We
have this story scoped out. So Anthony, I
think I know you have dependency on which
first ticket, but these are some things
you can start working on right now only,
right? This this thing is with the mock
data, right? You have the response
payload, right?Where is that
called, Right? You have the response
payload, right? Take this response
payload instead. Some dummy data, right?
You can just insert some dummy data. You
can. I think he's not checked in his
code yet, but yeah, you can just try
to bypass his piece and start coding. OK?
Yeah, yeah. Yeah, I said. Am I there in
that group? I I didn't get those
messages. Can you check? Well, you're
not. I think you should be. Let me, can
you share my screen?
Yeah, this is the group, right? The call
outing discussion, Yeah. Anthony, are you?
The most important. OK, so this is the
one that we've been using. Yeah, I was, I
was looking there. I didn't see. OK, and
that's it. If you have a couple of
minutes, I just want to be on the same
page because Anthony is also here. When I
was discussing with Vishwa, it was, uh,
Vishwas talking and we confused.
I know, yeah.
So, so, so this is my
understanding. Uh, let's see when we
submit, right, What we do.
We don't do this at all, OK?
I mean, I commented line #16 OK,
this is introduced. So what we do,
we just create the job lead job
in the database and then we just
call compute lead score and replace
priority. OK, yes, this gives me uh,
I mean, uh, it's inside which probably
I will hit the APA. What?
Right. Yeah, yeah, the new route and
everything and the small and everything.
Yeah, I have the response and I, I,
I, I, I showed this to Aisha as
well. He will be having something called,
you know, score, right. So I have great
score and get whatever. And then probably
I maintain a map wherein I have the
key. Can you maybe need ID uh, school
and VPS list? I just returned back that
back. OK, Yep. And then you insert it
in the lead job table. Yeah, now I
just go ahead. I have the service I
just aggregated because I don't want
everything in the call service.
OK, so I just go in the job service
where we call the repository, right? So
I, I pass on the map and then I
just go ahead and I, I see if it
is, if it is not empty, update, otherwise
whatever you throw that it's not scored,
whatever, right? Correct. Yeah. Ohh
yeah I think job repository or or
lead job. Leader, leader, right,
yeah, yeah, leader, right. So from the
yeah right. So you're updating the lead
job table with from the data from that.
Yep, Yep. And then you have very
handling. Yep. Makes sense. I think I
made these changes but Vishwas said he he
he took this so I'm leaving that to him
anyway. He made these changes yeah, but.
Make sure that yeah, so the most
important piece is commenting outline 60
here, right? Yeah, but but given he
was saying is he goes somewhere here
and uh, he just, uh, comments out
here and then he has some, some
other implementation, I'd like to I'd,
I'd leave that. To you guys, right on,
because I haven't looked at the full
code, right? I, I would leave that to you
guys on where you think it makes sense to
do it. But yeah, the idea is you when
the lead comes in, you don't send the
lead to the first VPS available and then
you score it. That just defeats the whole
purpose of smart. Call outing, right?
Lead comes in score, sender score
scheduler changes score is there. See the
priority based on the score based on the
time. See the priority list, right,
Assigned to the first apps. If he's busy,
well, if he's not busy, well, if he's not
going to second one and then yeah, make
sure it's concurrent, like all the leads
are happening at the same time. Yeah,
yeah, that's why. The implementation part
uh, and I mean, I showed him what I did
uh, if he wants to follow something else,
let him follow we, we can catch up on
that later yeah. So this again, can you
see this method over here? Send message
to technician like, why would you want to
go inside this method? And then yeah like
why is he even referring to this class
here?Yeah, I mean, yeah, all,
all I wanted to have is have this
separation. You you calculate it and
yeah. And then just pass it on to the
service and let the repository take. It's
actually, yeah, yeah, just update and and
the the jobs done over here. Yep.
With with the added, did you call
the AI model in any moment?
OK, Yeah, yeah. If you see this
is the one I, I just make
use the existing method, but forget about
this, he will give the new one,
will give new one. OK, Yeah, right
now we don't have the request I
think. I think that's just a confliction
because in visual perspective. He was
going he was just keep that, you
know, send message method as as it
was and inside the method he just
wanted to get rid of the the
the line, you know, whoops, OK, sending
message line just if you go to
the send message to the technician
function again. Yeah,
which one you mean to say just
text message to? Yeah, yeah, yeah, yeah.
Surely we we don't need to send
to the technician message directly. So he
got yeah, he commented that line, but
he wanted to keep that line for
like PS4 lead because that's where.
He called the model.
Yeah, but, but, but, but Anthony,
Anthony, we, we, we, we don't need to get
the yeah, I, I see your point here,
right? He's doing it over here. But I
think malicious implementation, right?
Because we don't need to get the PS map
from here, right? It needs to be
inserted. It's the scheduler's job that
needs to get the PS Map, right? Why like
why do we need to get PS map as part of
this one, right?This lead comes in
insert in job table. Instead of lead job
table call routing model, right call AI
call routing model, get the response to
insert and that's it. Right. Like
why would you want to get peace map over
here? Like what's the value? It's the
scheduler that needs to get the GPS map,
right? It's the scheduled to pick up the
job and then you need to get the PS map,
right? So I'm just thinking why even do
it over here? Like why is he trying to
get the PS map over here maybe?Uh,
maybe that he will call that
new, uh, data model. AE Sorry,
sorry, Assad. We assume the flow
as we submit, submit the green
light form and we instantly, you
know, ask for next step. We
scored the lead. Stop.
Uh, from direct, yeah, AI model, right.
Uh, but yes, in, in the single request
a model, we get the score, not only
score, but also the PS prior release,
right? So that's done. The AI model
request will be done right after the
green light forms submitted, not when the
schedule is. Working.
Well, yes, but.
The scheduler has but Anthony, I don't
see why we have to do it.
Lead comes in you instead in
the lead job table. Yep, you
create the request payload, call model
right, get the response. It says
all synchronously. This is happening
synchronously. Call model, get the data
response, insert in lead job table,
score and pslist. And that's it. So we
just need to insert. We don't need to
send message, right? That's it. We don't
need to do anything with Websocket right
now, right? Then the scheduler will run,
right? Every interval, it will check in
the lead job table something that has a
score and it will order on score, get the
highest score and then. You need to
get the PS list and then based on hey
it will say this is the first one it
needs to go to it you take the PS
list from the table only, not from the.
Yes exactly. The scheduler is just seeing
looking into the table, not looking into
the AI model. So AI model requests and
response will be. Done right
after the green light, green light
comes in. Yeah, exactly right. It's
all happening synchronously. Yeah, that's
where that the line like get
PS leads, they're allowing visual kept
which ones for like calling the
AI model request.
I thought, no, I thought that's a, that's
a different line called a model or maybe
I'm missing something. OK, yeah, because
the there's a separate piece of code.
Yeah, right. There's a whole AI mesh. Can
you show it again where you had the
the class to the method to call the
call routing?
Yeah, and get PS4
lead that's that's for
making the request to
AI model.
Yeah. So we need to do it again over
here. Yeah. I mean, I mean, if you, if
you don't want to do this here, let's
say, let's say if you don't want to do
this here, if he wants to retain this,
maybe he meant to say he will go inside
instead of this method, he will call the
new APA and he will get that. And
then, uh, pass it on to
repository. That's what is trying to
do.
Yeah, it would be, yeah. You're,
you're maybe possible you just on
the same direction, but there's a
little difference in terms of
implementation way. So yeah, easily,
yeah, little confliction actually you
don't want it to, yeah. Yeah.
I, I, I don't want to
touch this part apart from let's
say I just comment about this,
right? Yeah. Umm. And then these
methods can be reused. You don't
have to touch this.
Yeah, I'm just thinking we don't even
need to use this method here, right? So
where you were calling the AI when the
lead comes in, can you go back to
the green light service implementation
one controller. I'm sorry, which one?
Yeah, it's controller, right? Yeah, OK,
OK. So here. You
have the.
Was mapping submit OK? Submit happens,
right? You get a 200 OK, that's the
controller. Now where is the call routing
at the AI? Where are you billing the
request payload?
You mean my changes or the existing one?
Ohh just the existing one.
Existing here. Message inside
this and uh, so I see that API
call routing get PTSD is inside the send
send message, right? And then it's part
of the schedule again yeah. So what my
suggestion would be Anthony Malesh, why
not decouple this and put this in the
API layer only for the submit API?
Right, umm, sync, uh, right, maybe
asynchronously, right? So we did. When
it's inserted in the lead job
table, we send a message 200
HTTP code to front end for
the submit API and then in
the background asynchronously, we call
the call routing API, right?Yeah.
And then and then we insert, Yeah. So
you retain A200 right, 2 front end for
the submit API. And then asynchronously
you take the data that you got from
the submit API and you call the AI
call routing model, you get the request
and you create the request, you you get
the response. Instead the response in the
lead job table and that's it.
And then the scheduler runs and then the
send message to websocket comes in.
Right. So yeah, in the in the
same flow we should, you know, spin
up a new thread asynchronous. Yeah,
exactly. Yes, yes. But make sure you
return a 200, right? This is going
to be a separate thread, right? Yes,
right. Yeah, you can return a 200
to frontin when it's. Successfully
inserted in the lead job table. You don't
need to wait to call the record routing
model, get the score and then return it
200, right? That would not be a good user
experience in the front end. Correct.
Exactly. So in the same thread only in
this one only, Hmm, right. Yeah, we, we
don't need the send message to Websocket,
right? It's it's part of the submit API
only now part of that thread only. And
then the scheduler runs the scheduler
checks for anything that's scored, right.
Scheduler sends you the lead, Anthony,
you then see the PS list and then. You
ring the phone if it's busy, if if it's
ringing, you set the status to ringing.
If he answers, you set the status to
busy. If he does not answer, you set the
status to inactive. You move on to the
next one and you just continue with your
iterations for each one. Yeah, makes
sense. Yeah, I think this is a better
implementation. I agree with you. We
should not have the AI calling as far as
the websocket message again over here
within this thread, only within this
controller, only the submit API. You
return the message 200 or 201 if you want
to. 200 is fine, right technique, 200 is
fine over here, right? And in the new
thread. You start there, Yeah, I call out
Inquest. Correct. Yeah, we can do
that. Yes, yes, it's associated with this
only, right? It's not associated because
we're not sending the message to VPS now
anymore. We first score scheduler picks
up the score and then sends the message.
Yeah. Right.
Cool, cool. So talk to tomorrow in your
time aligned with him on these changes,
right. Yeah, and it can get a little
tricky, but which one the call he right.
So just talk to him be like you think
this is the best design and it's right
with all the cases that we talked about.
OK, yeah, yeah. So then. Uh, I will be
left with this exception handling. I will
be working on that. This is essentially
that part, right? I just want to be
exactly Yep, Yep, Yep. It's part of that
thread on that we just talked about
right? You instead lead job return 200 to
the apps submit API. You start a new
thread, you create the request payload,
get the response, inserting the lead.
Table right? This course which one does
the scheduler changes right? Which was
sent Anthony deletes right? Anthony, you
take the VPS list right? You check the
status right? You call when it's ringing.
Make sure you introduce a new status of
ringing so that when the next one comes
in, that same 1 is not being sent.
Yeah, yeah.
Right. And again, like you said, we
cannot, and this is the important piece,
we cannot let a lead run its course. If
two leads are in the queue, you don't
have to wait for first one to be picked
up before you assign BD two. The first it
tries to assign to the higher one if it's
if it answers. It's, it's his luck if it
does not it yeah, it can. It's, it's a
possibility that we could lead might get
answered before the first time. But we,
we, we this is something that's not in
our control, right? We, we, we don't know
when someone will be available now will
be available, right? But we are giving
the best chances for the first one,
right? Programmatically from your code,
we are giving the best chance. For the
higher lead to be answered first. But you
know, unknowns happen. You know, we think
that this one is, is busy, is active, but
maybe he might have stepped out, right?
These things can happen. We cannot
control that. Or maybe he just doesn't
want to take this call, right? We don't
know what the user's thinking. We just
know that he's active. We will send the
message. Right. Yeah. So
then in this scheduler part
there will be a change.
So what I see
President Joseph Seinfeld.
Someone changed it.
Here it is. So this is the
lead consecutive there. OK. So what's
happening now is.
To get the leads and
the trade through for each
we are sending. PLTS
message. So now it is happening in
a scheduler in asynchronous way.
Or asynchronous, I think it is
synchronous. Now if, if you see here, we
have the list of jobs. OK, umm, now
we look through the job for, for a
single job. If you see we are, we
are getting the PS. This is the existing
implementation. And yeah, we, we go
inside here. We we are talking about one
lead job as of now. OK, so I
go inside here. So if you see here,
it does everything OK, it sends all the
notification for all the PBS et cetera,
right?
And then?Uh,
control is looping through.
Yeah. So it is synchronous as of
now.
Umm, so we have to
make this.
I stink. Yeah, there
was. We want to make sure that it's not,
it does not go to the full loop, right?
Right. Situation of 1, then the second
iteration of the first one, right? It's
not just, hey, you're iterating through
the 1st the entire loop or the OR the
first lead, right?And you
could use experience, yeah, yeah, the
scenario that you mentioned in the
notepad and that that won't be met.
So we need to spin up a
thread separately for each and every lead
here for each hash map, right? So
if it's zero or one, so one
gets first. The second one for the one
comes again, right? Otherwise, if you
have it tomorrow, 10 VPS, you're waiting
for the first 3 to go to 10 VPS, then
for the second one, no, that's, that's
not going to work, right. So right now
what's happening is it gets the
dictionary or the JSON for the map, then
it goes through one, then second, then
third, then it comes to the second. Yeah.
So it's like a nested loop, right, Right.
So it's the first you have outside, you
have your array of your leads, the inside
for each lead you are iterating through
the map, right? No, I think that's where
it has to be. You have first that list
of lead, then for each lead, for the
first one, you get to the first one.
Right. Then for the for the second lead,
you get to the first one, right? Then for
the third lead, you get to the first one,
right? It's just happening in the loop,
right? It's, but you also have to make
sure that it will ring for 60 seconds for
the first one, correct? Now what can
happen is. So let's say I have 5 leads in
the queue, right?You guys make it 667
leads in the queue. So for the first
lead, when I say first, I'm talking about
the best lead, it, it rings for 60
minutes, right? It goes to and then so
there's some delay as well, right? So it
rings for the 1st 162nd, then we move on
to the second one, right, second one.
It rained for 60 seconds, right again.
Then we moved to the third one, right By
the time let's say we move to the third
one, right, the first for the lead one,
the first best whips has not answered and
it has been more than 60 seconds. So
before trying to assign, ideally before
trying to assign for the third lead. We
should move on to the second best
VPS for the first lead, right? So
we have to make sure we have
the call routing table here, right in
this table over here.
You, you, you, you were sharing and
expanding. OK, Yeah, yeah, I was just
saying here, wait, wait, actually let me
just show you the scenario. Yeah, right.
I have leads. Right.
12345678.
Now. For
lead one. Right. So
yeah, if I'm writing my loop, I'm
iterating through this, right? Yeah. But
each also has a list or a
map, right? So let's say one has,
right? One has this.
You mean the VPS? Exactly
right One has.
ABCDEF right?
OK 2
hash right.
BF something a right I'm
just making it up right
3 has something.
Right. Yeah,
the EWAI.
Right, I just examined 3 right now.
Ideally what should happen is.
Schedule runs, sends you the lead and
sends you the map for each of those.
OK, now you start with the first one
for lead one, right? This is the list.
You take lead one, right? Yeah. If you
do a nested array that's a nested loop,
that's not going to work because it
would. You have to go to this one, then
have to go through each and every one of
those. It has to be also inside a while
loop. It's thing right? That is, you take
the first lead, you ring the phone for A
right if A does not right while the phone
is ringing for A, move to B right now if
A did not answer. In 60
seconds, right? If it's on the 3rd
iteration for V, right? We have to make
sure that it moves to B before because
let's say if I have B over here
or let's say if I make the C
and if I have B over here, right?
A did not answer. Right now,
it's time to go to B, right?
But what can happen is it's been
more than 60 seconds.
It can move over here too. So be can
become busy here, right? So if it's been
60 seconds, it hasn't been answered.
We'll move to be over here then before
moving to be over here, right?
And right, makes sense, right? But why do
you have to do that? And this, this
is the tricky yeah, by the time if
the lead one didn't accept, by the time
it reaches to B, it is 60 first
second. But before that lead 3 has panag.
So if B can answer lead 3.
It will be busy with the late
three, yes, but I'm thinking.
So how will we handle this, right? So if
it's 64, if it's more than 60 seconds on
this one and it has an answer, should it
go to B? Should lead 3 go to B,
or should lead one go to B?
You know that that that
depends on.
Which thread? Uh, yes, as the
as the resource at that point
of execution, yes, 100% that's we
cannot control that, right? Yeah, right.
But yeah, because because all the threads
are running async, uh, they have their
own thread of execution, right? And we
don't know which thread gets the
resources yes. So the best way to
do it, yes, I agree We would
have all those things. We just need
to make sure Malaysia and Anthony. That
we are making sure our flags are always
correct and always updated. If a call is
ringing, ringing, right. So schedule is
not, it's not picking it up, it's only
picking up active who is active, who is
active, who doesn't have any call, who is
not in a call in his status is
green, right?Device, if you don't play
your statuses correctly, it's going to be
a big mess, right? So just make sure that
for each state there is a status
associated with it, right? If status is
only active, then only it goes to it.
Because yes, there's going to be multiple
sets spinning up right for each lead,
then you cannot know what iteration it is
on you. You just cannot do it right. So
there's going to be a little bit of hair
in there, which is fine, right? It's it's
now going to be perfect, but it's going
to be it's going to be better than just
making sure that you go through lead one
first, then lead 2. That's just going to
be not a good experience. So you go to
lead one and eight two, then you go to A,
then C, then B right, then B AFE right.
It's going to happen in process. You just
make sure, Anthony, that you have your
statuses active, inactive, busy and
ringing active. It should only go to
someone that is active, right? When the
phone is ringing, it is ringing. When
he's in a call, it is busy. When
he is not available, right, he is
inactive. I think if you make sure that.
Statuses are correct. We're not going to
have problems over here. Agree. Agree.
Yeah, yeah.
OK, Yeah, I think this call was helpful.
So Anthony, look into these things. Maybe
you're looking to these things that we
talked about spin up a new thread in
the in that same controller, right? You
return a 200, but asynchronously call the
API, get the score, insert right,
scheduler runs, gets the score, sends
Anthony. This list and this list for
each, you iterate through this entry. You
start with the first, then this one, then
you move to the second one. But you don't
have to make sure that you go through one
through this all. No, that's that's the
tricky piece. So if you if you do
something like this for I in Leeds,
right? And you do for J. In one, that's
going to be a problem because it's going
to go through this then this. No, we
cannot do that, right? It has to be make
sure that you start with delete and then
you start with the each element of the
first one, right? So this is not going to
be a nested loop, right? Where if you do
it this way. First go to this one, then
go to each of these, then go to each
of those. That's a problem. Do you see
what I'm trying to say here, right? If I
do for in leads and if I do for
J in one, then it'll go to first one,
then ABCDEF, then it'll go to two. That's
the problem. Right.
Right. Yeah. So all the
leads should have concurrent execution.
Exactly.
So you start with I and lead,
but how you handle this? You start
with 0 over here, zero over here,
zero over here, right? Then one, then
one, then one instead of 01234 instead
then 01234, right?
Yeah. And that that I think is where this
is become. This is intelligent. I feel
like that's like the same similar model
to how it's in Uber and Lyft in all the
spaces. Yeah. And I think yeah, yeah,
I, I was, I was hoping that like these
guys, they, they know how it's
complicated and tricky from a text
standpoint. Like they're, they're all
busy with the Group 2 stuff and the UI
things. But I feel like this is the more
interesting and complicated piece that
we're trying to solve. All right, Yeah, I
mean, from day one. This is what I was
stressing. Hold on. Yeah. And I was more
worried on the data model because that's
the crucial. I updated this to Kieran as
well. We we have most of the code
in place. The tricky part is get the
data model right and then we can play
it. Couldn't know that I am playing. The
like how we are, how I've been helping
with the design and all over here because
I know Kevin hasn't been joining the
call. Like does he know the role I'm
playing here?I'm
sorry, I haven't connected with Kieran.
So he knows that we had these design
calls, we're all aligned and everyone
like this is the new plan, right? How we
will do it? Because I know Karen has been
out of sync with this, right? He has now
been joining this call. So does he know
like we all have a plan, we all aligned
Yeah, yeah, he knows he's right and he.
He knows that how I've been helping with
the team yeah, Yeah, he knows. Yes. OK,
good. Because Karen and I haven't
connected because he was joined this
call. But I know's been busy with the
Group 1 stuff, but I want to make sure
that, you know, this is probably the most
complicated piece of the whole field
first thing, right? All that stuff is
easy, right? Yeah. Just have a UI, just
fetched data and show data on the UI.
This is where intelligent. My modeling is
yeah, but I think between us US 3 and
which one, I think we are in good shape.
I know it can be a little tricky, but
Vishwa right But Malaysia talked to visa
on your time. Talk to him why this will
work best. Anthony, you understand this
piece. I want to make sure right
scheduler runs that this has to be. OK,
you start with Yep. So I think, I think
you can just write, start writing your
pseudocode anyways, like I've kind of
have the studio, but start writing your
code now only, right? You can start
working with mock data, how you have a
lead, how you will iterate through each
of those, start a new thread. OK, OK,
Malaysia, question to you on the
architecture side, do we have enough
resources?Because if you create
multiple threads, right, then obviously
your computation for each goes down,
right? So now what's the maximum of
threads you can have, right? These are
community pods, right?
Yeah, I think,
uh.
See we we have one more issue
here alright but but as of now
see the the what we are doing
if if you observe in the source
code we are using hash map for
the storage but. But that
would be a big mess if we
go with the multi tenant deployment.
I mean, what if you have
more than one deployment? I mean
more than one server. So we
need to have a centralized caching
mechanism, something like Redis or Hazel.
So why this assumption? Is because
of the load balancer or what?
No, no. You know when
we are sending the notification
to the technicians, we are
maintaining the session data, all
those data in the Hashmap.
So Hashmap JVM, yeah, JVM
has its own copy of
Hashmap. Great. So what if
in a multi tenant environment, I mean
they they maintain their separate hash
map, they are not In Sync. So we
need to have some centralization
mechanism. I understand that's where your
DB comes in. So you have one DB,
but you can have multiple tenants, right?
So if it. Takes the data from DB,
then you can solve for that issue
somewhat right? Because I I see right if
110 goes down, yeah yeah DB is fine,
DB is fine. But what I'm saying is
I mean something which is not stored in
DB but just maintaining in Hashmap.
That's where the problem.
Yes, because it should be stored like
these things in the database for session
ID's and make sure it's always gets the
latest and the greatest from the
database. You think that will solve the
issue?I think, uh, no,
it's not a good idea to store
that in database probably in, uh, caching
like maybe release or has like a
centralized location. Yeah yeah, I see, I
see So I can help. I got
this to yeah, I bought this to
Kieran and. What's his
name? Subu his notice as well during
my initial code? I went through this
code and all and I explained.