Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Activity: add constructor from Event[State[T]]
This mirrors the one available in Var.

RB_ID=770338
  • Loading branch information
mariusae authored and jenkins committed Nov 23, 2015
1 parent 4895498 commit bc1119f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions util-core/src/main/scala/com/twitter/util/Activity.scala
Expand Up @@ -114,6 +114,12 @@ object Activity {

(Activity(v), w)
}

/**
* Constructs an Activity from a state Event.
*/
def apply[T](states: Event[State[T]]): Activity[T] =
Activity(Var(Pending, states))

/**
* Collect a collection of activities into an activity of a collection
Expand Down

0 comments on commit bc1119f

Please sign in to comment.