use of net.robinfriedli.aiode.function.HibernateInvoker in project aiode by robinfriedli.
the class AbstractCommand method invoke.
protected <E> E invoke(Callable<E> callable) {
HibernateInvoker hibernateInvoker = HibernateInvoker.create(context.getSession());
Mode mode = Mode.create().with(new MutexSyncMode<>(context.getGuild().getIdLong(), GUILD_MUTEX_SYNC));
return hibernateInvoker.invoke(mode, callable);
}
use of net.robinfriedli.aiode.function.HibernateInvoker in project aiode by robinfriedli.
the class AbstractCommand method invokeWithSession.
protected <E> E invokeWithSession(Function<Session, E> function) {
HibernateInvoker hibernateInvoker = HibernateInvoker.create(context.getSession());
Mode mode = Mode.create().with(new MutexSyncMode<>(context.getGuild().getIdLong(), GUILD_MUTEX_SYNC));
return hibernateInvoker.invokeFunction(mode, function);
}
Aggregations