Problem description
We have to explicitly pass context shifts to the things we want to do in the background, like:
taskGridBlocker
.blockOn(
TaskDao
.insertTasksByGrid(
Task
.TaskPropertiesCreate(
TaskStatus.Unlabeled,
projectId,
None,
None,
None,
None
),
tgf,
user
)
.transact(xa)
.start(taskGridContextShift)
)(taskGridContextShift)
I think we could instead do something like:
taskGridBlocker
.blockOn(
TaskDao
.insertTasksByGrid(
Task
.TaskPropertiesCreate(
TaskStatus.Unlabeled,
projectId,
None,
None,
None,
None
),
tgf,
user
)
.transact(xa)
)(taskGridContextShift).start
I believe that this should preserve the "ship it to the background" behavior while requiring fewer edits in the future -- you only have to remember to change one explicit context shift instead of two. We have this in a few places and are adding another in #5559
Problem description
We have to explicitly pass context shifts to the things we want to do in the background, like:
taskGridBlocker .blockOn( TaskDao .insertTasksByGrid( Task .TaskPropertiesCreate( TaskStatus.Unlabeled, projectId, None, None, None, None ), tgf, user ) .transact(xa) .start(taskGridContextShift) )(taskGridContextShift)I think we could instead do something like:
taskGridBlocker .blockOn( TaskDao .insertTasksByGrid( Task .TaskPropertiesCreate( TaskStatus.Unlabeled, projectId, None, None, None, None ), tgf, user ) .transact(xa) )(taskGridContextShift).startI believe that this should preserve the "ship it to the background" behavior while requiring fewer edits in the future -- you only have to remember to change one explicit context shift instead of two. We have this in a few places and are adding another in #5559