Exemplo n.º 1
0
 public void DispatchEvent(MainEvent e)
 {
     if (null != instance)
     {
         instance.Dispatch(e);
     }
 }
Exemplo n.º 2
0
 public void dispatchEvent(MainEvent e)
 {
     e.target = this;
     if (null != instance)
     {
         instance.Dispatch(e);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        ///     Notify all followers of a user that a new vlog was posted.
        /// </summary>
        /// <remarks>
        ///     A notification background task is dispatched to the
        ///     <see cref="DispatchManager"/> for each follower.
        /// </remarks>
        /// <param name="vlogOwnerUserId">Owner of the vlog.</param>
        /// <param name="vlogId">The posted vlog id.</param>
        public virtual async Task NotifyFollowersVlogPostedAsync(Guid vlogOwnerUserId, Guid vlogId)
        {
            _logger.LogTrace($"Notifying followers that {vlogOwnerUserId} posted vlog {vlogId}");

            await foreach (var user in _userRepository.GetFollowersAsync(vlogOwnerUserId, Navigation.All))
            {
                var notification = _notificationFactory.BuildFollowedProfileVlogPosted(user.Id, vlogId, vlogOwnerUserId);

                _logger.LogTrace($"Notifying follower {user.Id} that {vlogOwnerUserId} posted a vlog");

                _dispatchManager.Dispatch <NotifyBackgroundTask <DataFollowedProfileVlogPosted> >(notification);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        ///     Executes a vlog record request for all users that
        ///     belong to the DateTimeOffset.Now minute.
        /// </summary>
        /// <param name="stoppingToken">Cancellation token.</param>
        protected override void DoPeriodicWork(CancellationToken stoppingToken)
        {
            var now    = DateTimeOffset.UtcNow;
            var minute = new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0, TimeSpan.Zero);

            _dispatchManager.Dispatch <VlogRequestCycleBackgroundTask>(minute);
        }
Exemplo n.º 5
0
 public override void _PhysicsProcess(float delta)
 {
     Profiler.Stop("Physics");
     Profiler.Start("Physics");
     DispatchManager.Dispatch(new Events.FixedUpdate()
     {
         delta_time = delta
     });
     DispatchManager.Dispatch(new Events.LateFixedUpdate()
     {
         delta_time = delta
     });
 }
Exemplo n.º 6
0
 public override void _Process(float delta)
 {
     DispatchManager.Dispatch(new Debug());
     Profiler.Stop("Update");
     Profiler.Start("Update");
     DispatchManager.Dispatch(new Events.FrameUpdate()
     {
         delta_time = delta
     });
     DispatchManager.Dispatch(new Events.LateFrameUpdate()
     {
         delta_time = delta
     });
 }
Exemplo n.º 7
0
        public IActionResult PostVlog([FromServices] DispatchManager dispatchManager, [FromServices] Core.AppContext appContext, [FromBody] VlogDto input)
        {
            // Act.
            var postVlogContext = new PostVlogContext
            {
                IsPrivate = input.IsPrivate,
                UserId    = appContext.UserId,
                VlogId    = input.Id,
            };

            dispatchManager.Dispatch <PostVlogBackgroundTask>(postVlogContext);

            // Return.
            return(NoContent());
        }
Exemplo n.º 8
0
 public override void _EnterTree()
 {
     PauseMode = PauseModeEnum.Process;
     DispatchManager.Dispatch(this);
 }
Exemplo n.º 9
0
 public override void _Input(InputEvent @event)
 {
     DispatchManager.Dispatch(@event);
 }