Skip to content

Commit acb8e1d

Browse files
committed
changed async function
1 parent 5ba2a90 commit acb8e1d

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

src/Cache/CacheConfigTrait.hack

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,21 @@ trait CacheConfigTrait {
3434
'servers' => vec[],
3535
);
3636

37-
public function setMemcachedCacheConfig(
37+
public async function setMemcachedCacheConfigAsync(
3838
MemcachedConfig $memcachedConfig
39-
): void {
39+
): Awaitable<void> {
4040
$this->memcachedConfig = $memcachedConfig;
4141
}
4242

43-
public function setFilesystemCacheConfig(
43+
public async function setFilesystemCacheConfigAsync(
4444
FileSystemConfig $FileSystemConfig
45-
): void {
45+
): Awaitable<void> {
4646
$this->FileSystemConfig = $FileSystemConfig;
4747
}
4848

49-
public function setCacheDriver(Driver $driver): void {
49+
public async function setCacheDriverAsync(
50+
Driver $driver
51+
): Awaitable<void> {
5052
$this->cacheDriver = $driver;
5153
}
5254

src/Cache/Resolver/MemcachedResolver.hack

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class MemcachedResolver {
3232
if($servers is nonnull) {
3333
foreach ($servers as $value) {
3434
$m->addServer($value['host'], $value['port'], Shapes::idx($value, 'weight', 0));
35-
3635
}
3736
}
3837
return $m;

src/Foundation/ApplicationConfig.hack

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ class ApplicationConfig implements ConfigInterface {
3636
protected vec<classname<ConsistentServiceProvider>> $providers = vec[];
3737
protected vec<classname<AsyncMiddlewareInterface>> $middlewares = vec[];
3838

39-
public function setRoutes(
39+
public async function setRoutesAsync(
4040
dict<HTTPMethod, ImmMap<string, \Nazg\Routing\TResponder>> $routes
41-
): void {
41+
): Awaitable<void> {
4242
$this->routes = $routes;
4343
}
4444

4545
public function getRoutes(): dict<HTTPMethod, ImmMap<string, \Nazg\Routing\TResponder>> {
4646
return $this->routes;
4747
}
4848

49-
public function setLogConfig(shape('logfile' => string, 'logname' => string) $logConfig): void {
49+
public async function setLogConfigAsync(shape('logfile' => string, 'logname' => string) $logConfig): Awaitable<void> {
5050
$this->logfile = $logConfig;
5151
}
5252

5353
public function getLogConfig(): shape('logfile' => string, 'logname' => string) {
5454
return $this->logfile;
5555
}
5656

57-
public function setServiceProviders(
57+
public async function setServiceProvidersAsync(
5858
vec<classname<ConsistentServiceProvider>> $providers
59-
): void {
59+
): Awaitable<void> {
6060
$this->providers = $providers;
6161
}
6262

tests/ApplicationTest.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class ApplicationTest extends HackTest {
3939
$container = new Container(new DependencyFactory());
4040
$app = new Foundation\Application($container, $read, $write);
4141
$config = new Foundation\ApplicationConfig();
42-
$config->setRoutes(
42+
await $config->setRoutesAsync(
4343
dict[HTTPMethod::GET => ImmMap{
4444
'/' => shape(
4545
'middleware' => vec[],

0 commit comments

Comments
 (0)