-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run aqua code from CLI #324
Conversation
…stead of import, dirty WIP code
npm/aqua/caller.aqua
Outdated
@@ -0,0 +1,9 @@ | |||
service Console("console"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this file exist in the npm/aqua
folder?
val multiaddrOpt: Opts[String] = | ||
Opts | ||
.option[String]("addr", "Relay multiaddress", "a") | ||
.withDefault("/dns4/stage.fluence.dev/tcp/19002/wss/p2p/12D3KooWMigkP4jkVyufq5JnDJL6nXvyjeaDNpRfEZqQhsG3sYCU") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose a Krasnodar network's node should be there.
@@ -134,7 +138,9 @@ object AquaCli extends IOApp with Logging { | |||
helpFlag = false, | |||
None | |||
)( | |||
main[IO](runtime), | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to keep these braces?
@@ -33,6 +36,8 @@ object AppOps { | |||
Validated.fromEither(toLogLevel(str)) | |||
} | |||
|
|||
def runCom[F[_]: Monad: Files: AquaIO: Async](implicit ec: ExecutionContext): Opts[F[ExitCode]] = Opts.subcommand(RunOpts.runCommand[F]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does runCom
mean?
import scala.concurrent.{ExecutionContext, Future} | ||
|
||
object RunCommand { | ||
def run[F[_]: Monad: Files: AquaIO: Async](multiaddr: String, func: String, input: Path, imps: List[Path])(implicit ec: ExecutionContext): F[Unit] = ??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs
) | ||
_ <- peer.stop().toFuture | ||
} yield { | ||
Validated.Valid({}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace {}
with ()
|
||
val generatedFuncName = "callerUniqueFunction" | ||
|
||
def run[F[_]: Monad: Files: AquaIO: Async]( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Docs?
Async
is already aMonad
AirBackend, | ||
config | ||
) | ||
parsingTime = System.currentTimeMillis() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Timer
typeclass instead.
With System.currentTimeMillis
you actually don't know what time you are measuring: when a FlatMap
case class is built, or when it's executed, or what.
|
||
object RunCommand extends Logging { | ||
|
||
def funcCall(multiaddr: String, funcName: String, air: Generated, config: TransformConfig)( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs
Please update the minor version and add the performance improvements which are already implemented, and let's have it in the wild as an unstable experimental feature. |
Aqua functions could be run from the console:
This feature won't be published until fixing performance issues