Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

去除EventBus中事件发布的wait参数,需要非阻塞时应该在handler中处理 #208

Closed
gmf520 opened this issue Mar 16, 2021 · 0 comments
Labels
Breaked Changes ⚡ 更新有破坏性,对现有业务实现有较大影响 Feature 🔨 新功能,新特性 Finished ✔️ 实现并完工
Milestone

Comments

@gmf520
Copy link
Member

gmf520 commented Mar 16, 2021

您的功能请求与现有问题有关吗?请描述

  • EventBus中Publish的wait参数是用于非阻塞处理需求的
  • 非阻塞处理应该在handler中实现,而不是需要在publish中决定

描述您想要的解决方案

去除wait参数及相关实现

···

    /// <summary>
    /// 同步发布指定事件
    /// </summary>
    /// <typeparam name="TEventData">事件数据类型</typeparam>
    /// <param name="eventData">事件数据</param>
    /*/// <param name="wait">是否等待结果返回</param>*/
    void Publish<TEventData>(TEventData eventData/*, bool wait = true*/) where TEventData : IEventData;

    /// <summary>
    /// 同步发布指定事件,并指定事件源
    /// </summary>
    /// <typeparam name="TEventData">事件数据类型</typeparam>
    /// <param name="eventSource">事件源,触发事件的对象</param>
    /// <param name="eventData">事件数据</param>
            /*/// <param name="wait">是否等待结果返回</param>*/
    void Publish<TEventData>(object eventSource, TEventData eventData/*, bool wait = true*/) where TEventData : IEventData;

    /// <summary>
    /// 同步发布指定事件
    /// </summary>
    /// <param name="eventType">事件数据类型</param>
    /// <param name="eventData">事件数据</param>
            /*/// <param name="wait">是否等待结果返回</param>*/
    void Publish(Type eventType, IEventData eventData/*, bool wait = true*/);

    /// <summary>
    /// 同步发布指定事件,并指定事件源
    /// </summary>
    /// <param name="eventType">事件数据类型</param>
    /// <param name="eventSource">事件源,触发事件的对象</param>
    /// <param name="eventData">事件数据</param>
    /*/// <param name="wait">是否等待结果返回</param>*/
    void Publish(Type eventType, object eventSource, IEventData eventData/*, bool wait = true*/);

···

@gmf520 gmf520 added this to the v5.0.4 milestone Mar 16, 2021
@gmf520 gmf520 added Breaked Changes ⚡ 更新有破坏性,对现有业务实现有较大影响 Feature 🔨 新功能,新特性 labels Mar 16, 2021
@gmf520 gmf520 added the Finished ✔️ 实现并完工 label Mar 16, 2021
@gmf520 gmf520 closed this as completed Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaked Changes ⚡ 更新有破坏性,对现有业务实现有较大影响 Feature 🔨 新功能,新特性 Finished ✔️ 实现并完工
Projects
None yet
Development

No branches or pull requests

1 participant