Skip to content

Commit

Permalink
Merge pull request #1911 from lift/msf_issue_1902
Browse files Browse the repository at this point in the history
Consider LiftRules.cometCreation while building comets
  • Loading branch information
farmdawgnation authored Sep 15, 2017
2 parents dfab883 + 734dba7 commit c97b7ea
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2491,8 +2491,9 @@ class LiftSession(private[http] val _contextPath: String, val underlyingId: Stri
/**
* As with `findOrBuildComet[T]`, but specify the type as a `String`. If the
* comet doesn't already exist, the comet type is first looked up via
* `LiftRules.cometCreationFactory`, and then as a class name in the comet
* packages designated by `LiftRules.buildPackage("comet")`.
* `LiftRules.cometCreationFactory`, then `LiftRules.cometCreation`, and
* finally as a class name in the comet packages designated by
* `LiftRules.buildPackage("comet")`.
*/
private[http] def findOrCreateComet(
cometType: String,
Expand Down Expand Up @@ -2572,12 +2573,14 @@ class LiftSession(private[http] val _contextPath: String, val underlyingId: Stri
}

// Given a comet creation info, build a comet based on the comet type, first
// attempting to use LiftRules.cometCreationFactory and then building it by
// attempting to use `LiftRules.cometCreationFactory` and then attempting to
// find a match in `LiftRules.cometCreation`. Failing those, this will build it by
// class name. Return a descriptive Failure if it's all gone sideways.
//
// Runs some base setup tasks before returning the comet.
private def buildCometByCreationInfo(creationInfo: CometCreationInfo): Box[LiftCometActor] = {
LiftRules.cometCreationFactory.vend.apply(creationInfo) or {
LiftRules.cometCreationFactory.vend.apply(creationInfo) or
NamedPF.applyBox(creationInfo, LiftRules.cometCreation.toList) or {
val cometType =
findType[LiftCometActor](
creationInfo.cometType,
Expand Down

0 comments on commit c97b7ea

Please sign in to comment.