Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 05:01

    xerial on master

    Update scalafmt-core to 3.0.5 (… (compare)

  • 05:01
    xerial closed #1851
  • Sep 25 19:18
    codecov[bot] commented #1851
  • Sep 25 19:11
    scala-steward opened #1851
  • Sep 25 01:02
    codecov[bot] commented #1850
  • Sep 25 00:56
    scala-steward closed #1849
  • Sep 25 00:56
    scala-steward commented #1849
  • Sep 25 00:56
    scala-steward opened #1850
  • Sep 23 22:54
    codecov[bot] commented #1849
  • Sep 23 22:48
    scala-steward closed #1847
  • Sep 23 22:48
    scala-steward commented #1847
  • Sep 23 22:48
    scala-steward opened #1849
  • Sep 23 17:31

    xerial on master

    Update postgresql to 42.2.24 (#… (compare)

  • Sep 23 17:31
    xerial closed #1848
  • Sep 23 13:13
    codecov[bot] commented #1848
  • Sep 23 13:07
    scala-steward opened #1848
  • Sep 23 04:19

    xerial on master

    Update grpc-netty-shaded, grpc-… (compare)

  • Sep 23 04:19
    xerial closed #1846
  • Sep 23 01:25
    codecov[bot] commented #1847
  • Sep 23 01:25
    codecov[bot] commented #1846
Taro L. Saito
@xerial
thx for the fix
Duy Pham
@phamthaibaoduy
Thanks
Duy Pham
@phamthaibaoduy
Hello, I have one question. It is possible to do multi-binding with provider method?
I wanna inject a Logger into target class, but Logger should be created with target class name
Duy Pham
@phamthaibaoduy
@xerial Thank Taro, but this can not be used for my purpose
Taro L. Saito
@xerial
How about using bind { s:String => Logger} (provider binding)?
Duy Pham
@phamthaibaoduy
Yes that would be helpful, only if Airframe somehow can correctly pass target class name as input for the provider
Taro L. Saito
@xerial
def newLogger(name:String) = Logger(name), and
bind {newLogger}
will work
I see. We need to resolve the logger nave automatically
Duy Pham
@phamthaibaoduy
Yes
I'm wondering if it's possible to have some contextual param, which would be passed by airfame to provider

case class Context (target: ClassMetaData)

something like this

Taro L. Saito
@xerial
Unfortunately there is no feature like that.
Duy Pham
@phamthaibaoduy
design
  .bind[Logger].toInstanceProvider{ (context: Context) => 
    new Logger(context.target.getClass) 
  }
Are you a maintainer of the airframe
Taro L. Saito
@xerial
Yes. I’m the creator of Airframe :)
Duy Pham
@phamthaibaoduy
Do you happen to know if it's possible to implement this feature, I would love to work on it but I need some help, the airframe source code is quite complex to me, a scala beginner
Wow
Taro L. Saito
@xerial
For this logger example, we don’t need to use provider. Just binding a provider that creates a new logger:
bind { new Logger(this.getClass) }
Duy Pham
@phamthaibaoduy
I wanna keep dependencies injected via constructor args
Taro L. Saito
@xerial
Then you can try using val f = bindFactory[Context => Logger], then you need to manually call f(context)
Duy Pham
@phamthaibaoduy
I can think of a work-around, which is to inject the LoggerFactory into target
Taro L. Saito
@xerial
Actually we already have a ticket for this use case wvlet/airframe#190
Duy Pham
@phamthaibaoduy
But it would be nice if the DI framework auto-wiring can fully take care of building dependencies
wow
Do you have any plan to get that issue resolved any time soon :D
Taro L. Saito
@xerial
This functionality can be implemented by writing a helper class (e.g., creating a logger from a given LoggerFactory and a context class information), so I believe we should not add this functionality to Airframe (because it makes the framework much more complex). Just having an example for doing so will be enough in this case.
Duy Pham
@phamthaibaoduy
@xerial I just found out that Alias type binding does not work with Constructor, I guess it is because of constructor injecting is done at runtime
If it's true, maybe we should update the document https://wvlet.org/airframe/docs/bindings.html#type-alias-binding
Taro L. Saito
@xerial
Could you give me an example code which didn’t work?
Duy Pham
@phamthaibaoduy
Sorry Taro, I thought I left response for your questions
It was mistake from my side, I did not know exactly what it is, but the problem went away after a clean recompile
Taro L. Saito
@xerial
Good to know that. Thanks for reporting!
Duy Pham
@phamthaibaoduy
Thank you
Duy Pham
@phamthaibaoduy
@xerial is it possible to use life cycles with design binding
I guess it's only useable with in trait injection?
Taro L. Saito
@xerial
onXXX hooks are available only for in-trait injection. For regular classes, you can use JSR250 annotations
like PostConstruct, PreDestroy
Duy Pham
@phamthaibaoduy
Thanks for answering
Ivano Pagano
@ivanopagano
Hello everyone
I'm trying to configure the airframe-log to avoid logging in tests, completely... I've been setting the -Xmacro-setttings to disable it in sbt Test config, yet the logs come up nonetheless... is the webpage docs up-to-date? Does the flag works for latest compiler versions?
*settings
Glen Marchesani
@fizzy33
is there a better place to ask questions than here ?
last message was Oct 28, 2020
Hanns Holger Rutz
@Sciss
Hi there. does airframe-msgpack support any sort of automatic case class formats that I can use to model APIs (such as Neovim). Or is it just low level encoding / decoding?
Hanns Holger Rutz
@Sciss

And regarding airframe-rpc, does this only work with http servers, or can I use it to implement neovim bindings? I don't understand yet how you define an asynchronous interface. Like

@RPC
trait API {
  def greet(s: String): String
}

how does that become asynchronous? Or do I have to explicitly define

@RPC
trait API {
  def greet(s: String): Future[String]
}

?

Hanns Holger Rutz
@Sciss
what's the reason there is no wvlet.airframe.msgpack.spi.Value.IntValue, but the factory will always create a LongValue even when given scala.Int?