Skip to content

Deadlocks. #279

@escfrya

Description

@escfrya

Hi guys! First of all, thanks for great work!
We use ReactiveKit a lot and after our project was grown we ran into problem with deadlocks.

Most of our Services(business logic) works in this way:

event
    .with(latestFrom: state)
    .map { event, state in
    	var newState = state
    	// Apply event to state
        return newState
    }
    .bind(to: state)

With time logic gets complicated and dependencies to other services state is appear. After that deadlocks started to show up.

I prepared example project to reproduce problem here.

Project contains two cases in which deadlock is reproduced and comparision with other rx implementations(RxSwift, Combine).
RxSwift works similar.
In Combine deadlocks not reproduced.

After click Reproduce deadlock1 or Reproduce deadlock2 and pause app execution, you see blocked threads:
deadlock

Also found this article described same problem.

May be we are using ReactiveKit incorrectly, and you have some suggestion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions