Skip to content

Good practice to add annotations for what thread things will be called on #3

@doncung

Description

@doncung

In your method calls especially when you are changing data, it is good practice to annotate your methods with the expected thread they will be called from i.e. UiThread or AnyThread. Thinking about threading will help you avoid tricky race condition problems in the future for example here you could potentially run into unexpected consequences if this reset method is called while the user is scrolling as both could be touching the isLoading boolean. If you know both methods are on the same UI thread then such a race condition in theory isn't possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions