Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

The annotation only accept const value #12

@oldbig

Description

@oldbig

The following code not works:

import com.softwaremill.macmemo.memoize

class GraphBuilder {
  val max = 20000
  // val max = read from props file.
  @memoize(maxSize = max, expiresAfter = 2 hours)
  def creatGraph(elementCount: Int): Graph = {
    someExpensiveCode()
  }

}

what about making the parameters are call by name? just like this:

class memoize(maxSize: => Long, expiresAfter: => FiniteDuration, concurrencyLevel: => Option[Int] = None)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions