[0:00] Horizon is a awesome Laurel package [0:03] which help you to manage your cues and [0:06] jobs and it it has a beautiful dashboard [0:09] which you can see how much jobs is [0:13] running and how much phase how much runs [0:16] pending and other things now let me show [0:19] you in this video uh how we use it in [0:22] Kodi Pals and also how we use it in [0:24] other projects we can also configure it [0:27] for yourself in any projects and I will [0:29] just talk about the basics so this video [0:33] should be quick and don't forget to [0:35] subscribe and like this video if you [0:38] like if you're interested okay let's go [0:43] um [0:44] so I'm in the quadri pals and uh [0:48] installing Horizon first the mod first [0:52] go to learn documents document [0:55] and [0:58] as you can see in here on the packages [0:59] there is a horizon package in here [1:02] there's a documentation it's completed [1:05] and we don't need anything else but I [1:08] will go through this document and let me [1:10] show you how we configure it our [1:13] application so first we need to install [1:15] the prison so just I'm using the sale [1:22] composite require larval Horizon and [1:25] everything is ready in my project then [1:28] we must do publish some configs and [1:30] install the Horizon uh [1:33] here so after this [1:37] okay we just need to use the sale [1:39] Artisan Horizon install and everything [1:42] is ready in here so uh you may see some [1:46] files that add to your projects uh one [1:49] of the file is Horizon on the config [1:51] file a config folder and this is the [1:54] basic config of the Horizon and it's [1:57] good to see and we will check this about [2:00] the [2:01] we have just something about this [2:05] default and supervisor in here if you're [2:07] using on production and local and [2:10] everything else you can config the [2:13] things in here uh the [2:16] important things is about the production [2:18] which we use this [2:20] uh but for now just we are changing [2:24] something on defaults and I will show [2:26] you there uh but before using the person [2:30] we must to put a change our color [2:33] connection to Q connection to reduce as [2:37] you may see in here on the previous [2:39] video we did it on the database and here [2:42] we must do change it to radius and after [2:46] you change it to radius you must to [2:48] configure already's host and password [2:49] important other things uh I'm using here [2:52] a Docker as you may see in the could we [2:56] pass project also on production we have [2:58] a pass a platform as a service we are [3:01] using that and there is a ready stair [3:05] which we can connect to that redis [3:08] and here we are just using our cache [3:11] sending our cues to redis and the [3:16] Horizon View watch our cues and run them [3:20] and it gives us good [3:22] data so how we can run it but before [3:27] running any commands here for running [3:31] Horizon you must do [3:34] go on localhost [3:36] and [3:38] reason address and as you can see here [3:41] there is some jobs and activities and [3:44] other things but this sort of you know [3:46] and if you see I have some completed job [3:51] but not for now [3:53] and it's the failed job and other things [3:56] in here but let me activate this version [3:59] for activating Horizon we just need to [4:03] run artisan [4:06] Horizon [4:08] and everything will be fine in here so [4:12] as you can see we are using the Q [4:15] default in here and the process will [4:18] change why this has changed it's because [4:21] of the on the config as you can see we [4:24] are using balance Auto and this balance [4:27] Auto will be balance our processes [4:31] between the super multiple supervisor [4:33] wizard [4:34] and this will change this process and if [4:38] you have a lot of jobs in EQ it will [4:42] increase the process and manage by [4:46] itself [4:48] so we don't [4:51] need to change a lot this Horizon but if [4:55] you have multiple cues uh like we in a [5:00] project we had a lot of cues and a lot [5:03] of jobs fire on two queues and one queue [5:07] was about making another jobs making [5:11] some jobs for another queue and uh we [5:15] had a slow q and fast and in Horizon we [5:20] just separate them by each other and it [5:23] helps us to gives more process to [5:28] this queue to run faster and [5:33] do more jobs and the slower do some more [5:37] do some less and how we can do this in [5:40] here as you can see we have some super [5:42] Resort also on production and local we [5:45] have things but I will change this [5:47] default if your environment was the [5:49] production this will be run in here but [5:53] here on supervisor I can make another [5:56] super wizard here and we can change the [6:00] queues in here uh the Q name in here [6:03] which will reach supervisor will run [6:06] which cubes here so we have defaults in [6:09] Kodi files we don't have too much cues [6:13] but [6:14] you can check you can Define uh which [6:19] queue which job in run in which queue on [6:23] the job [6:25] let me find the job in the [6:28] there is this is a job [6:31] you just need to [6:33] public [6:36] queue let me see [6:39] yes [6:40] this is and just name it something like [6:44] a Discord [6:46] it's the job of the Discord and here I [6:50] can just run this [6:53] Discord in here don't forget to [6:56] uh it's running like this [7:00] restart the Horizon oh if you change any [7:04] code on your jobs you need to change you [7:07] need to restart the Horizon in your [7:10] local [7:11] others it will not run and as you can [7:15] see we have a Discord and the default in [7:17] here and if the Discord jobs increases [7:21] the process will be increases in here [7:24] but there is some also limitations like [7:28] how Max process we have and other things [7:31] that you can see in here [7:33] so [7:34] just one more step we are using Horizon [7:38] also in production uh with uh as here [7:42] let me show you [7:44] which The Horizon in here could we Pals [7:46] for reason and you see the Forbidden in [7:49] here because I'm not logged in and if I [7:53] log in by my accounts [7:56] here [7:58] okay [7:59] so I can see the Horizon in here and [8:03] everything will be fine [8:05] but how to prevent [8:08] other users to access this Horizon [8:11] because we don't want to act we don't [8:15] want them to access this [8:18] there's an ability on Horizon service [8:20] provider which you can see in here on [8:23] the gate [8:25] in this case [8:28] as you can see there is a user and in [8:32] email we in Array which will check which [8:36] user can access to the Horizon by [8:39] default it's empty so how we config this [8:44] we made on the horizon in here [8:48] make some make an array called admins [8:54] and put the admins email in here which [8:57] My email is [9:00] this and here we can instead of the [9:04] empty array uh called uh Verizon [9:15] to make mistake and admins it's in here [9:18] and by default we have a empty array in [9:23] here [9:23] so this little bit code will prevent [9:27] other user to access the Horizon and [9:31] just add means we Define will be [9:33] accessed here also you can put a complex [9:37] logic here like if your system has a [9:39] rule rule and permissions you can check [9:42] in here it's uh it's a gate and [9:46] hopefully we could talk about the gates [9:49] and policies in future in some video [9:52] okay so let's check some features of the [9:57] Horizon on the horizon dashboard as you [10:01] can see I have a lot of failed job in [10:04] the code V Pals and in here on the fail [10:08] job we can see what happened and what's [10:11] the error in here [10:13] so there is some error and if you fix [10:16] the error and push the codes you just [10:19] need to retry this and it will be run [10:22] another time and all everything will be [10:24] fine [10:26] and this things [10:28] okay thank you for watching I try to [10:31] explain how we use Horizon and go to [10:33] vitals and some [10:36] examples so if you interest in this kind [10:41] of video please like And subscribe to [10:42] the channel and in the next video I see [10:46] you we want to talk more about the queue [10:49] and the jobs so goodbye