/addinpromises

make async coding experience easier

Primary LanguageR

How to Use

  1. Install:
devtools::install_github("harryprince/addinpromises")
  1. Add shortcut

Currently, setup shortcut as CMD + shift + B.

  1. Insert code

addinpromises

Based on R pakcage promises, you can easily convert a sync R code block to async. Here is the example:

dependecies:

library(future)
library(promises)

The original sync code:

spark_df %>%
   head(1000) %>%
   collect() %>% # mostly time-consuming process
   View()

After asynchronized:

future(spark_df) %...>%
    head(1000) %...>%
    collect() %...>% # Now you are free
    View()

After you claim your pipeline asynchronised, now you can do another meaningful job instead of waiting spark collecting data or another time-consuming computing.