Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 10 21:42

    xerial on master

    airframe-rx: Add Rx.timer/delay… (compare)

  • Apr 10 21:42
    xerial closed #1583
  • Apr 10 21:34
    codecov[bot] commented #1583
  • Apr 10 21:28
    codecov[bot] commented #1583
  • Apr 10 21:28
    xerial synchronize #1583
  • Apr 10 21:23
    codecov[bot] commented #1583
  • Apr 10 21:17
    xerial synchronize #1583
  • Apr 10 21:15
    xerial synchronize #1583
  • Apr 10 21:14
    xerial opened #1583
  • Apr 10 02:34

    xerial on master

    airframe-rx: Lazily evaluate Ca… (compare)

  • Apr 10 02:34
    xerial closed #1582
  • Apr 10 02:25
    codecov[bot] commented #1582
  • Apr 10 02:22

    xerial on master

    Update trino-main to 355 (#1581) (compare)

  • Apr 10 02:22
    xerial closed #1581
  • Apr 10 02:19
    xerial opened #1582
  • Apr 09 03:04
    codecov[bot] commented #1581
  • Apr 09 02:59
    scala-steward opened #1581
  • Apr 08 20:02

    xerial on master

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

  • Apr 08 20:02
    xerial closed #1579
  • Apr 08 20:02
    xerial commented #1579
Duy Pham
@phamthaibaoduy

https://wvlet.org/airframe/docs/index.html#in-trait-injection

I don't get how airframe can know which name should be used for the database

Naoki Takezoe
@takezoe
@phamthaibaoduy This example may not work because name is not given.
@xerial Probably we should fix this example. Simply removing name from Connection is ok?
Naoki Takezoe
@takezoe
Sorry, it was removing from Database, not Connection.
Naoki Takezoe
@takezoe
I created a pull request: wvlet/airframe#354
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