data = yield from asyncio.get_event_loop().sock_recv(self.__conn, 256)
Sends are delayed until consumer completion. To override this, you may pass immediately=True.
Channel('some-channel').send(message, immediately=True)
response.sendRedirect("/admin")
вызывается filterChain.doFilter(req, resp);
. После редиректа обработку запроса надо прерывать :try {
response.sendRedirect("/admin");
return;
} catch (IOException e) {
e.printStackTrace();
}
\timing
и выполнять интересующие вас запросы. int numbers[] = new int[] {1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 8, 8, 9};
int number = Arrays.stream(numbers)
.filter(n -> n % 2 == 0)
.boxed()
.collect(
Collectors.groupingBy(
Function.identity(),
Collectors.counting()))
.entrySet()
.stream()
.max(Map.Entry.comparingByValue(Long::compareTo))
.map(Map.Entry::getKey)
.get();
@Entity
public class Zone {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@OneToOne(mappedBy = "zone")
private ZoneDescription description;
// Геттеры и сеттеры не указаны для краткости
}
@Entity
public class ZoneDescription {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@OneToOne
private Zone zone;
@ManyToOne(optional = false)
private ZoneLanguage language;
// Геттеры и сеттеры не указаны для краткости
}
@Entity
public class ZoneLanguage {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
/* Раскоментировать, если нужна двунаправленная связь
@OneToMany(mappedBy = "language")
private Set<ZoneDescription> descriptions = new HashSet<>();
*/
// Геттеры и сеттеры не указаны для краткости
}
Zone zone = zoneRepository.getById(zoneId);
ZoneDescription description = zone.getDescription();