Codota Logo
FutureInterpreter
Code IndexAdd Codota to your IDE (free)

How to use
FutureInterpreter
in
com.novarto.sanedbc.netty

Best Java code snippets using com.novarto.sanedbc.netty.FutureInterpreter (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: novarto-oss/sane-dbc

/**
 * Submits this operation for execution in the executor service. The operation is executed with connection autoCommit = true,
 * i.e. non-transactionally.
 */
public <A> Future<A> submit(DB<A> op)
{
  return withConnection(op, true);
}
origin: novarto-oss/sane-dbc

private <A> Future<A> withConnection(DB<A> op, boolean autoCommit)
{
  return ex.submit(() ->
  {
    try (Connection c = getConnection(autoCommit))
    {
      return op.run(c);
    }
  });
}
origin: novarto-oss/sane-dbc

@Test public void sanity()
{
  Future<Integer> success = dbAsync.submit(DB.unit(42));
  SQLException ex = new SQLException("failed i have");
  Future<Integer> fail = dbAsync.submit(DB.db((Try1<Connection, Integer, SQLException>) c ->
  {
    assertThat(c, is(notNullValue()));
    throw ex;
  }));
  assertThat(awaitAndGet(success), is(42));
  assertThat(awaitAndGetFailure(fail), is(ex));
}
origin: novarto-oss/sane-dbc

@BeforeClass public static void setupHikari()
{
  ds = Hikari.createHikari("jdbc:hsqldb:mem:JdbcUtilsTest", "sa", "", new Properties());
  ex = Hikari.createExecutorFor(ds, false, () ->
      new UnorderedThreadPoolEventExecutor(0, new DefaultThreadFactory("sanity-test"))
  );
  dbAsync = new FutureInterpreter(ds, SanityTest.ex);
}
origin: novarto-oss/sane-dbc

/**
 * Submits this operation for execution in the executor service. The operation is executed as a transaction.
 */
public <A> Future<A> transact(DB<A> op)
{
  return withConnection(transactional(op), false);
}
com.novarto.sanedbc.nettyFutureInterpreter

Most used methods

  • <init>
  • getConnection
  • submit
    Submits this operation for execution in the executor service. The operation is executed with connect
  • withConnection

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getSystemService (Context)
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Notification (javax.management)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now